Lurker News
Creator here. I built ChartGPU because I kept hitting the same wall: charting libraries that claim to be "fast" but choke past 100K data points.

The core insight: Canvas2D is fundamentally CPU-bound. Even WebGL chart libraries still do most computation on the CPU. So I moved everything to the GPU via WebGPU:
- LTTB downsampling runs as a compute shader - Hit-testing for tooltips/hover is GPU-accelerated - Rendering uses instanced draws (one draw call per series)
The result: 1M points at 60fps with smooth zoom/pan.
Live demo: https://chartgpu.github.io/ChartGPU/examples/million-points/
Currently supports line, area, bar, scatter, pie, and candlestick charts. MIT licensed, available on npm: `npm install chartgpu`
Happy to answer questions about WebGPU internals or architecture decisions.

Comments (214) 75 threads

Show all comments

Showing thread 18 of 75

pier255 replies#
Very cool. Shame there's not a webgl fallback though. It will be a couple of years until webgpu adoption is good enough.

https://caniuse.com/webgpu

sroussey1 reply#
It’s available everywhere if you are on newest OS and newest browser.

Biggest issue is MacOS users with newer Safari on older MacOS.

kawogi1 reply#
Support for Firefox on Linux is still only in nightly (unless that changed "very" recently)

This blocks progress (and motivation) on some of my projects.

Joeboy#
Apparently you can turn it on with about:config / dom.webgpu.enabled

But personally, I'm not going to start turning on unsafe things in my browser so I can see the demo. I tried firefox and chromium and neither worked so pfft, whatever.

johndough#
And even if WebGPU is enabled, the implementation might still be broken or inefficient in various ways. For example, Firefox uses some ridiculous polling-based approach [1] to check for completion, which disqualifies the implementation for many performance-critical applications.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1870699
And there is the issue of getting the browser to use the correct GPU in the first place, but that is a different can of worms.

m132#
+1

Please support a fallback, ideally a 2D one too. WebGPU and WebGL are a privacy nightmare and the former is also highly experimental. I don't mind sub-60 FPS rendering, but I'd hate having to enable either of them just to see charts if websites were to adopt this library.
The web is already bad requiring JavaScript to merely render text and images. Let's not make it any worse.

dapperdrake#
WebGL punts to WebGPU for decent compute shaders.