I made a custom mark for showing complex functions. It can be changed simply to render GLSL shaders. I tried my best to avoid any memory leak and optimized it as much as I knew and was able, but if you find something I missed, let me know.
Wow, this is awesome. Great use of a custom mark in Observable Plot, and integrating d3-zoom! We think this might be the first example weâve seen of using GLSL in a custom Plot mark.
There are some similarities with Ricky Reusserâs complex function plotter (see implementation). Ricky also has a fantastic notebook on adaptive contouring. Check those out if you havenât seen them already.
Fil and I are hoping to bring native support for zooming to Plot soon (or, eventually), which might make this slightly easier. In any case, well done, and thank you for sharing! ![]()
Thanks! There is one issue I havenât figured out how to fix. When the resolution is smaller than the plot, it gets stretched to fit the screen, and d3-zoom breaks.