Had an idea while looking at some old Python code and thought it might be fun to animate a path navigation algorithm I wrote awhile back. This was also a good excuse to play some more with React Hooks and also rendering SVG graphics.
So, it took a few minutes to re-write the original Python function in Javascript and the next step was to do some graphics!
I was just about to open up InkScape to draw the SVG graphics, when I happened to remember that draw.io allows you to export drawings to SVG on the clipboard. That makes it pretty easy to draw something by hand, then paste the resulting SVG into JSX as a starting point for instrumenting it with code.
Anyway, here’s a short video showing the results. The code is on my CodeSandbox.io link.
After running this a few times I found a problem with on-the-fly Resets which I will post a follow-up on soon.