{"version":3,"sources":["components/DisplayNode.jsx","components/GeneratorInfo.jsx","components/SolverInfo.jsx","components/DisplayGrid.jsx","components/Settings.jsx","components/Menu.jsx","components/MenuKey.jsx","components/Footer.jsx","App.js","reportWebVitals.js","index.js"],"names":["DisplayNode","props","state","style","height","width","handelDragStart","bind","handelDragLeave","handelDragOver","handelDrop","this","setDragObject","start","end","setState","pos","e","preventDefault","backgroundColor","classList","draggable","wallLeft","push","wallBottom","type","filter","x","index","animation","animationDelay","speed","className","join","onDragStart","onDrop","onDragOver","onDragLeave","React","Component","GeneratorInfo","info","title","generator","SolverInfo","solver","heuristic","DisplayGrid","dragObject","renderTable","setStart","setEnd","Array","from","grid","keys","map","_","i","j","nodes","padding","generateAlgorithm","solveAlgorithm","Settings","show","handelSizeChange","setHeuristic","handleClickOutside","document","addEventListener","removeEventListener","event","domNode","ReactDOM","findDOMNode","contains","target","value","setSize","size","min","onChange","name","id","defaultValue","max","step","setSpeed","onClick","renderSettings","Menu","setAlgorithm","generate","setSolve","solve","clearGrid","MenuKey","Footer","marginTop","marginLeft","color","href","App","algorithm","solved","maze","api_endpoint","fetchGrid","solveGrid","should_solve","alert","node","a","clear_node_index","then","Promise","resolve","fetch","json","method","body","JSON","stringify","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","render","StrictMode","getElementById"],"mappings":"iQACqBA,E,kDACjB,WAAYC,GAAO,IAAD,8BACd,cAAMA,IACDC,MAAQ,CACTC,MAAM,CAACC,OAAO,IAAI,EAAKH,MAAMG,OAAQC,MAAM,IAAI,EAAKJ,MAAMI,QAG9D,EAAKC,gBAAkB,EAAKA,gBAAgBC,KAArB,gBACvB,EAAKC,gBAAkB,EAAKA,gBAAgBD,KAArB,gBACvB,EAAKE,eAAiB,EAAKA,eAAeF,KAApB,gBACtB,EAAKG,WAAa,EAAKA,WAAWH,KAAhB,gBATJ,E,mDAWlB,WACII,KAAKV,MAAMW,cAAcD,KAAKE,MAAQ,QAAUF,KAAK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BX,MAAK,YAAkD,IAA/CY,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdnD,IAAS0D,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFhE,SAASiE,eAAe,SAM1BV,M","file":"static/js/main.b0ff8b27.chunk.js","sourcesContent":["import React from \"react\"\nexport default class DisplayNode extends React.Component{\n constructor(props){\n super(props)\n this.state = {\n style:{height:600/this.props.height, width:600/this.props.width}\n }\n //bind the methods to the object so that the \"this\" keyword refers to the object no matter where the method is called from\n this.handelDragStart = this.handelDragStart.bind(this);\n this.handelDragLeave = this.handelDragLeave.bind(this);\n this.handelDragOver = this.handelDragOver.bind(this);\n this.handelDrop = this.handelDrop.bind(this);\n }\n handelDragStart(){//set the type of node that is being dragged\n this.props.setDragObject(this.start ? \"start\" : this.end ? \"end\" : \"\")\n }\n handelDrop(){//move the node that was being dragged to the new position\n this.setState({style:{height:600/this.props.height, width:600/this.props.width}});\n this.props.handelDrop(this.props.pos)\n }\n handelDragOver(e){//when another node is dragged over this node, set the style of the node to be pink\n e.preventDefault();\n this.setState({\n style:{\n backgroundColor:\"pink\",\n height:600/this.props.height,\n width:600/this.props.width\n }\n })\n }\n handelDragLeave(){//remove the pink style when the node is no longer being dragged over\n this.setState({\n style:{height:600/this.props.height, width:600/this.props.width}\n })\n }\n render(){//render the node as a table cell\n //generate a list of css classes for this node\n this.classList = [\"node\"];\n //set default values for the node\n this.draggable = false;\n this.start = false;\n this.end = false;\n //add walls to the node classList\n if (this.props.wallLeft){\n this.classList.push(\"wall_left\")\n }\n if (this.props.wallBottom){\n this.classList.push(\"wall_bottom\")\n }\n //add path to node classList\n if (this.props.type === \"path\"){\n this.classList.push(\"node_path\")\n }else{\n //Remove the \"node_path\" item from the classList if it isn't a path, as when maze is resolved the nodes would remain a path node if it was a path node before.\n this.classList.filter(x => {return x !== \"node_path\"})\n }\n //add attributes for the start node or remove them if this node is no longer the start node\n if (this.props.pos[0] === this.props.start[0] && this.props.pos[1] === this.props.start[1]){\n this.classList.push(\"node_start\")\n this.draggable = true\n this.start = true\n }else{\n this.classList.filter(x => {return x !== \"node_start\"})\n this.start = false\n }\n //add attributes for the end node or remove them if this node is no longer the end node\n if (this.props.pos[0] === this.props.end[0] && this.props.pos[1] === this.props.end[1]){\n this.classList.push(\"node_end\")\n this.draggable = true\n this.end=true\n }else{\n this.classList.filter(x => {return x !== \"node_end\"})\n this.end=false\n }\n\n if(this.props.index){//Each node is given an index when it is visited so the order of the visited nodes can be visualized\n if (this.props.type !== \"path\"){//Add css animations for to show the visited nodes\n this.state.style = {\n animation: `visit_node 2s linear forwards`,\n animationDelay: `${this.props.index*this.props.speed}s`,\n height:600/this.props.height,\n width:600/this.props.width\n }\n }else{//Add css animations for to show the path nodes\n this.state.style = {\n animation: \"visit_node_path 2s linear forwards\",\n animationDelay: `${this.props.index*this.props.speed}s`,\n height:600/this.props.height,\n width:600/this.props.width\n } \n }\n }else{\n //removes the colour if the node is no longer visited after the maze is solved again\n if (!this.state.style.backgroundColor){\n this.state.style = {\n height:600/this.props.height,\n width:600/this.props.width\n }\n }\n }\n \n return(\n \n \n )\n }\n}","export default function GeneratorInfo(props) {\n let info;\n let title;\n if (props.generator === \"prims\"){\n title = \"Prim's Algorithm\"\n info = \"Prim's algorithm starts at one point, and expands the graph by removing walls from the graph that connect the current node to the closest unvisited node. The algorithm continues until all nodes are connected.\"\n }else if (props.generator === \"recursive_backtracking\"){\n title = \"Recursive Backtracking\"\n info = \"Recursive backtracking works by choosing a random wall to remove that connects the current node to another node that is not in the maze. The algorithm continues until all adjacent nodes are in the maze, and then it backtracks and repeats the process.\"\n }\n return(\n
\n

{title}

\n

\n {info}\n

\n
\n )\n}","export default function SolverInfo(props) {\n let info;\n let title;\n if (props.solver === \"dijkstra\"){\n title = \"Dijkstra's Algorithm\"\n info = \"Dijkstra's algorithm works by expanding outwards from the start node, adding a distance from the start to each visited node, until the end node is found. The algorithm then works backwards from the end node, choosing the node with the smallest distance at all opportunities. It is guaranteed to find the shortest path.\"\n }else if (props.solver === \"dfs\"){\n title = \"Depth First Search\"\n info = \"Depth First Search works by searching from a start node and fully exploring a path before moving on to the next node. It uses a stack to store the nodes that it needs to explore. It is not guaranteed to find the shortest path.\"\n }else if (props.solver === \"bfs\"){\n title = \"Breadth First Search\"\n info = \"Breadth First Search works by searching from a start node and expanding outwards radially until it reaches the end node. It uses a queue to store the nodes that it needs to explore. It is not guaranteed to find the shortest path.\"\n }else if (props.solver === \"greedy\"){\n title = \"Greedy\"\n info = \"The greedy algorithm works by finding the node with the lowest heuristic value and expanding it. It is a greedy algorithm because it will always choose the node with the lowest heuristic value. It is not guaranteed to find the shortest path.\"\n if (props.heuristic === \"manhattan\"){\n info += \"The manhattan heuristic is calculated by |x1 - x2| + |y1 - y2|.\"\n }else if (props.heuristic === \"euclidean\"){\n info += \"The euclidean heuristic is calculated by sqrt(x1 - x2)^2 + (y1 - y2)^2.\"\n }\n }\n return(\n
\n

{title}

\n

\n {info}\n

\n
\n )\n}","import React, { Component } from \"react\";\nimport DisplayNode from \"./DisplayNode\";\nimport GeneratorInfo from \"./GeneratorInfo\";\nimport SolverInfo from \"./SolverInfo\";\nexport default class DisplayGrid extends Component{\n constructor(props){\n super(props);\n this.state = {\n dragObject: \"\"\n }\n //bind the methods to the object so that the \"this\" keyword refers to the object no matter where the method is called from\n this.renderTable = this.renderTable.bind(this);\n this.handelDrop = this.handelDrop.bind(this);\n this.setDragObject = this.setDragObject.bind(this);\n }\n handelDrop(pos){//move the node that was being dragged to the new position\n switch (this.state.dragObject){\n case \"start\":\n this.props.setStart(pos)\n break;\n case \"end\":\n this.props.setEnd(pos)\n break;\n default:\n break;\n }\n }\n setDragObject(type){//set weather start or end node is being dragged\n this.setState({\n dragObject:type\n })\n }\n renderTable(){//render the grid as a table\n return(\n \n \n {Array.from(Array(this.props.grid.height).keys()).map((_, i) => {//iterate through the rows of the grid\n return(\n \n {Array.from(Array(this.props.grid.width).keys()).map((_, j) => {//iterate through the nodes in each row\n return(\n \n )\n })}\n \n )\n })}\n \n
\n )\n \n }\n render(){\n //If there is a grid, render it, else show a message\n if (this.props.grid){\n return(\n
\n \n \n \n
\n )\n }\n return(\n
\n

No grid to display

\n

Check your internet connection

\n
\n )\n }\n}","import React from \"react\"\nimport ReactDOM from \"react-dom\"\n\nexport default class Settings extends React.Component {\n constructor(props){\n super(props);\n this.state = {\n show: false,\n heuristic: \"euclidean\"//set default heuristic to euclidean\n }\n //bind the methods to the object so that the \"this\" keyword refers to the object no matter where the method is called from\n this.handelSizeChange = this.handelSizeChange.bind(this);\n this.setHeuristic = this.setHeuristic.bind(this);\n this.handleClickOutside = this.handleClickOutside.bind(this);\n }\n componentDidMount(){//add an event listener to the document so that the settings dropdown menu can be hidden if the user clicks outside of it\n document.addEventListener(\"mousedown\", this.handleClickOutside);\n }\n componentWillUnmount(){//remove the event listener from the document when the component is removed from the DOM\n document.removeEventListener(\"mousedown\", this.handleClickOutside);\n }\n handleClickOutside(event){//hide the settings dropdown menu if the user clicks outside of it\n const domNode = ReactDOM.findDOMNode(this);\n if (domNode && domNode.contains(event.target)) {\n return\n }\n this.setState({show: false});\n\n }\n handelSizeChange(e){//change the size of the grid when it is changed in the settings\n let value = e.target.value;\n this.props.setSize({height:value, width:value})\n }\n \n setHeuristic(heuristic){//set the heuristic to the selected heuristic\n this.setState({\n heuristic: heuristic\n })\n this.props.setHeuristic(heuristic)\n }\n\n renderSettings(){//render the settings dropdown menu\n return(\n
\n
\n

Size

\n this.handelSizeChange(e)}/>\n
\n
\n

Greedy Heuristic

\n \n
\n
\n

Speed

\n {this.props.setSpeed(0.3 - e.target.value)}} /> \n
\n \n
\n )\n }\n render(){//render the settings button and the settings dropdown menu if it is clicked\n return(\n
\n \n {\n //show the settings dropdown menu if the button is clicked\n this.state.show ? this.renderSettings() : null \n }\n
\n )\n }\n}","import React from 'react';\nimport Settings from './Settings';\nexport default function Menu(props) {//Menu bar for the app \n return(\n
\n \n \n \n \n \n \n
\n )\n}","import React from \"react\";\n\nexport default function MenuKey(props){//key for showing the different types of node\n return(\n
\n
\n
\n

Start Node

\n
\n
\n
\n

Finish Node

\n
\n
\n
\n

Path Node

\n
\n
\n
\n

Visited Node

\n
\n
\n )\n}","export default function Footer() {\n return (\n
\n

GitHub | This website was created by Oliver Temple for a Computer Science A Level NEA

\n
\n )\n }","import './App.css';\nimport { Component } from 'react';\nimport DisplayGrid from './components/DisplayGrid';\nimport Menu from './components/Menu';\nimport MenuKey from './components/MenuKey';\nimport Footer from './components/Footer';\nclass App extends Component {\n constructor(props){\n super(props);\n this.state = {\n grid: null,//the grid of nodes\n algorithm: null,//algorithm for generating the maze\n solve:null,//algorithm for solving the maze\n nodes:{\n start: [0,0],//position of the start node\n end: [null, null]//position of the end node\n },\n size: {//size of the maze\n width:15,\n height:15\n },\n heuristic: \"euclidean\",\n speed:0.1\n }\n\n this.solved = false;\n this.maze = false;\n this.api_endpoint = \"https://jkrlv64tsl.execute-api.eu-west-2.amazonaws.com/default/NEA\"\n //bind the methods to the object so that the \"this\" keyword refers to the object no matter where the method is called from\n this.fetchGrid = this.fetchGrid.bind(this);\n this.setAlgorithm = this.setAlgorithm.bind(this);\n this.clearGrid = this.clearGrid.bind(this);\n this.setSolve = this.setSolve.bind(this);\n this.solveGrid = this.solveGrid.bind(this);\n this.setSize = this.setSize.bind(this);\n this.setStart = this.setStart.bind(this);\n this.setEnd = this.setEnd.bind(this);\n this.should_solve = this.should_solve.bind(this);\n this.setHeuristic = this.setHeuristic.bind(this);\n this.setSpeed = this.setSpeed.bind(this);\n }\n\n componentDidMount(){\n //generate a new maze empty when the page loads\n this.clearGrid();\n }\n\n setHeuristic(heuristic){//set the heuristic for the greedy algorithm\n this.setState({heuristic: heuristic});\n }\n setSpeed(speed){//set the speed of the animation\n this.clearGrid();\n this.setState({speed: speed});\n }\n setSize(size){//set the size of the grid when changed in settings\n if(size.width > 30 && size.height > 30){//if the size is too large, alert the user\n alert(\"The size of the maze must be less than 30.\")\n return;\n }\n this.setState({\n size: size\n }, () => {//setState is asynchronous, so we need to wait for it to finish before running the following code \n if (size.width > 0 && size.height > 0 && size.width < 31 && size.height < 31){//if the size is valid, generate a new maze\n this.clearGrid();\n }\n })\n }\n setStart(node){//set the start node\n this.setState({\n nodes:{\n start: node,\n end: this.state.nodes.end\n }\n }, () => {//setState is asynchronous, so we need to wait for it to finish before running the following code\n this.should_solve()//solve the maze again if it is already solved\n })\n }\n setEnd(node){//set the end node\n this.setState({\n nodes:{\n start: this.state.nodes.start,\n end: node\n }\n }, () => {//setState is asynchronous, so we need to wait for it to finish before running the following code\n this.should_solve()//solve the maze again if it is already solved\n })\n }\n\n async should_solve(){//if the maze is already solved, then solve again. Only run when the start or end nodes are changed\n if (this.solved){\n this.clear_node_index()//clear the index of the nodes, as the maze is being solved again\n .then(() => {\n this.solveGrid();\n })\n }\n }\n\n async clear_node_index(){//clear the index of the nodes so that the maze can be solved again\n return new Promise(resolve => {//since there are asynchronous calls, we need to wait for them to finish before running the code after the clear_node_index function, hence we use a promise that is resolved once this code is finished\n let grid = this.state.grid.grid\n //iterate through the grid and clear the index of the nodes\n for (let i=0; i {\n resolve(); // resolve the promise once the state has been updated\n })\n })\n \n }\n async fetchGrid(){//generate a new maze from the python API using the selected algorithm\n if (this.state.algorithm){//check that there is an algorithm selected for generating the maze\n let grid = await fetch(`${this.api_endpoint}?type=generate&width=${this.state.size.width}&height=${this.state.size.height}&generate=${this.state.algorithm}`)//fetch the generated grid from the python API\n grid = await grid.json();//convert the response to json\n this.setState({//update the state with the new grid\n grid:grid\n })\n this.solved = false;//the maze is no longer solved\n this.maze = true;//set the maze to true as a maze has been generated\n }else{//If there is no algorithm selected to generate the maze, alert the user\n alert(\"Please select a maze generating algorithm\")\n } \n }\n async solveGrid(){//send the maze to the python API to be solved with the requested algorithm\n await this.clear_node_index();//clear the index of the nodes, as the maze is being solved again\n\n if (!this.maze || !this.state.solve){\n if (!this.maze){\n alert(\"Please generate a maze before solving it\")\n }else{\n alert(\"Please select a maze solving algorithm\")\n }\n return\n }\n let grid = await fetch(\n `${this.api_endpoint}?type=solve&width=${this.state.size.width}&height=${this.state.size.height}&solve=${this.state.solve}&start=${this.state.nodes.start}&end=${this.state.nodes.end}&heuristic=${this.state.heuristic}`, {\n method: \"POST\",\n body: JSON.stringify(this.state.grid)//set the body of the request to the grid\n })//send the maze to the python API to be solved, with the selected algorithm as a parameter\n grid = await grid.json();//convert the response to json\n this.setState({//update the state with the new grid\n grid:grid\n })\n this.solved = true;//the maze is now solved\n \n }\n async clearGrid(){//generate an empty maze from the API\n let grid = await fetch(`https://jkrlv64tsl.execute-api.eu-west-2.amazonaws.com/default/NEA?type=empty_maze&width=${this.state.size.width}&height=${this.state.size.height}`)//fetch the empty grid from the python API\n grid = await grid.json();//convert the response to json\n this.setState({//update the state\n grid:grid,//update the state with the new grid\n nodes:{//set the start and end nodes to default positions\n start: [0,0],\n end: [this.state.size.height - 1, this.state.size.width - 1]\n }\n })\n this.maze = false;//there is no longer a maze to solve\n this.solved = false;//the maze is no longer solved\n }\n setAlgorithm(algorithm){//set the maze generating algorithm\n this.setState({\n algorithm: algorithm\n })\n }\n setSolve(algorithm){//set the maze solving algorithm\n this.setState({\n solve:algorithm\n })\n }\n render(){\n return (\n
\n \n \n \n
\n
\n );\n }\n}\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}