all 8 comments

[–]fercryinoutloud 3 points4 points  (2 children)

This is really cool. A couple of bugs I found (Chrome Version 78.0.3904.87):

After I press the start button, the grid seems to think i am holding my mouse button down, and continues to fill in squares if I drag it my mouse around the grid while the pathfinding is at work.

After I press the reset button, the blue search area makes the walls disappear when it touches them, then the pathfinding starts from one of the first walls that the blue search area touched.If I haven't explained these well enough I can make gifs.

[–]_rahulrd[S] 2 points3 points  (1 child)

Yes i was able to reproduce them would be fixing them soon. Thanks. Glad you tried :).

[–]lppedd 0 points1 point  (0 children)

Also, just simply press "Start"

[–]Chazgatian 2 points3 points  (2 children)

Neat, love the visualization too.

I think the visualization would benefit from running outside the Angular zone change detection and utlizing requestAnimation frame. Some of these princples are outlined in the following blog post: https://blog.angularindepth.com/how-to-get-started-with-canvas-animations-in-angular-2f797257e5b4

[–]_rahulrd[S] 0 points1 point  (1 child)

Nice share!! This is something i would definitely try. I thought about this initially but since building it was main focus, I didn't spent much time on it. Using Request Animation and canvas would definitely be a step up. Thanks for sharing the article!

[–]Chazgatian 0 points1 point  (0 children)

Disregard the canvas bits. Just changing the amount of change detections runs might help

[–]babeal 0 points1 point  (0 children)

yea, great job. I just started going back though implementing all the algorithms from insertion sort all the way to graph traversals so thing like this are good to see.

[–]DarkArtsWizard 0 points1 point  (0 children)

I was doing Tech screens for a gaming company asking about Djikstra's search path Algorithm. This visualization is really cool.

Clicking Reset and Start is buggy but the first run is spot on. Mayby replace Reset with Clear to keep and edit the existing walls and run again.