I’ve just published a notebook that allows the user to explore several Appollonian packings where the curvature of each circle is an integer:
I’m pretty happy with it but there are a couple of oddities:
- You might notice a strange overlap between input and output. This is particularly noticeable if you expand a markdown cell, as in:
The cause is certainly related to the fact that I’m using Pure CSS.
- I found it pretty tricky to get
d3.zoomto work properly. The reason is that zooming requires more than just a simple redraw of what’s already on the canvas; you’ve got to actually refine and recompute the picture on zoom-end. That required a reset of the
zoom.transformon zoom-end, since I already had my function fully written to work with a specified rectangle not worrying about any transform imposed on the canvas. The final result has a couple of strange properties:
* Double click is slightly slow to respond since each mouseup fires a zoom-end resulting in two unnecessary redraws. It would be nice to be able to ignore those mouseups.
* You can zoom in as far as you want, even though there’s a
zoom.scaleExtentspecified. Naturally, you don’t have to zoom in too far before numerical error becomes apparent.