Copying a twitter thread[1] here for more explanation<p>I built CandyGraph a few months ago to scratch an itch and never really got around to talking about it, but it's starting to get some use now, so here it is: <a href="https://github.com/wwwtyro/candygraph" rel="nofollow">https://github.com/wwwtyro/candygraph</a><p>I wanted a plotting library that was designed to not only plot a zillion points very fast, but also deal with changes to the presentation of that data at interactive framerates. If I zoomed in on the plot, for example, I wanted the axes to update fast enough that I wouldn't have to worry about the hit. If I changed an axis from linear to log, the rendered data would update immediately; I didn't want the CPU to churn through a million data points and ship them to the GPU again before it rerendered.<p>So CandyGraph was born. It adopts D3's elegant concept of scales, but it implements them on both the CPU and GPU. When data is rendered, the scaling takes place in the vertex shader. Changing a scale wont cause a missed frame.<p>On top of scales sits coordinate systems, also implemented for the CPU and GPU. These combine multiple scales into a system capable of dealing with 2D points. It has cartesian and
polar coordinate systems, currently.<p>It renders everything on the GPU, even axes and text. No need to overlay your speedy WebGL plot with an SVG or another canvas for your axis rendering, and no need to take a perf hit for doing so. And of course, the data rendering itself is speedy; it's all instanced by default.<p>Finally, CandyGraph comes with a small but growing collection of optimized primitives and higher-level objects to simplify common plotting tasks.<p>If this sounds like it might scratch your itch, check out the tutorial and examples:
<a href="https://wwwtyro.github.io/candygraph/tutorial/dist/" rel="nofollow">https://wwwtyro.github.io/candygraph/tutorial/dist/</a>
<a href="https://wwwtyro.github.io/candygraph/examples/dist/" rel="nofollow">https://wwwtyro.github.io/candygraph/examples/dist/</a><p>CandyGraph is built on top of the embarassingly good regl library. CandyGraph is in major version zero, but it's usable (and in use) today.<p>[1]<a href="https://twitter.com/wwwtyro/status/1396500134716973063" rel="nofollow">https://twitter.com/wwwtyro/status/1396500134716973063</a>