Solving a Maze with D3.js
bl.ocks.org
bl.ocks.org
Maze Generator: http://bl.ocks.org/mbostock/11159599
Maze Solver: http://bl.ocks.org/mbostock/11161648
Maze Flooder: http://bl.ocks.org/mbostock/11167589
Maze Solver with Best-First Search Algorithm: http://bl.ocks.org/mbostock/11189414
(Edit: Best-First Search, not A*.)
It's awesome to see interesting algorithm visualizations in D3 (or other web standards) as opposed to Java applets. Especially as a student who has to do algorithm visualizations... in Java applets.
★ There are algorithms that generate each possible maze with equal probability, if by maze you mean a spanning tree of the grid graph. I used such an algorithm, Wilson's algorithm.
Cool example of canvas[0] vs svg[1]. The canvas renders heavy animation a bit better. Both are around the same number of lines of code.
For my latest project I used a kineticjs canvas to get handlers on the canvas shapes. That's positioned on top of a d3-bound svg container. Best of both worlds, reasonable speed up to a couple thousand canvas shapes. Though it was quite tricky getting the same input events to trigger separate handlers on sibling dom elements. (Can't just let the events bubble up unless you make the canvas a child of the svg or vice-versa, but that approach creates more problems.)
Now there are a dozen new Javascript creations each week on HN that make my jaw drop.
It's amazing how far it's come.