Live data from Hacker News

Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

github.com

211–220 of 226 posts

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#211
Since I still see this on the front page, I am taking the liberty to plug my own funny experiment (still WIP).

By no mean it is as nice looking as your demo, but it is interesting to ME... C++, compiled to WASM, using WebGL. Works on Firefox too. M4 decimation.

https://one-million-points-wasm.netlify.app/

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#213
post #93

All charts in the demo failed for me. Error message: "WebGPU Error: Failed to request WebGPU adapter. No compatible adapter found. This may occur if no GPU is available or WebGPU is disabled.".

I'm getting the same error, but ://gpu shows that WebGPU is "Hardware accelerated"

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#214
post #14

Earlier quoted context omitted.

Have you thought about leaning into some of the fintech space? They'd happily pay for the sorts of features they need to stream financial data (which is usually bazillions of data points) and graph it efficiently. Off the top of my head, look into Order Book Heatmaps, 3D Volatility Surfaces, Footprint Charts/Volatility deltas. Integrating drawing tools like Fibonacci Retracements, Gann Fans etc. It would make it very…

Absolute gold comment here :) This comment was buried yesterday. I'm sorry for the late response! I was thinking about a pro tier for this kind of specialized stuff. Core stays MIT forever, but fintech tooling could be paid. Of the chart types you listed, is there a preference for what gets done first? Order Book Heatmaps first?

No problem :) I asked a friend who's a bit closer to the space and he agrees, definitely Order Book Heatmaps. The speed you're getting would make this a killer feature.

Competitors typically have to snapshot/aggregate because their graphing libraries are heavily CPU bound. Being able visualise level 2/3 data without downsampling is a big win. Also being able to smoothly roll back through the last 12hrs of tick-level history would be really neat too.

I'd say the bare minimum feature set outside of that is going to be:

- Non linear X axis for gaps/sessions

- Crosshairs that snap to OHLC data

- Logarithmic scales, Candlesticks, Heikin-Ashi, and Volume profiles

- Getting the 'feel' nice so that you can quickly scale and drag (people are real sticklers for the feel of these tools)

- Solid callbacks for events for exchange integration, people hate leaving their charts to place an order eg (onOrderModify etc)

- Provide a nice websocket data ingestion pipeline

- Provide an api so devs can integrate their own indicators, some sort of 'layers' API or something.

Sorry if I can't be of more help as I'm just a hobbyist in this area!

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#215

What's the best way to get all those points from a backend into the frontend webgpu compute shader? There doesn't seem to be a communication mechanism that has minimal memcopy or no serialization/deserialization, the security boundary makes this difficult. I have a backend array of 10M i16 points, I want to get this into the frontend (with scale & offset data provided via side channel to the compute shader). As it st…

Look up trasnferable objects, it's not new. The fetch api can get you ArrayBuffers that you can shuffle around zero copy, besides to webgl buffers, also to web workers. But minimizing copying or avoiding format conversions doesn't necessarily get you best performance of course.

I had a look, that certainly looks like part of the solution, now I need to get that array buffer from my backend into the browser runtime transferable object.

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#216
post #126

Earlier quoted context omitted.

Emm.. no, you just do one render pass to a temp framebuffer with 1 red channel, then another fragment shader maps it to an RGB palette.

Wait, does additional blending let you draw to temp framebuffers with high precision and without clamping? Even so you'd still need to know the maximum value of the temp framebuffer though.

That's what EXT_float_blend does. It's true, though, that you can't find the global min/max in webgl2. This could be done, theoretically, with mipmaps if only those mipmaps supported the max function.

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#217

Earlier quoted context omitted.

Absolute gold comment here :) This comment was buried yesterday. I'm sorry for the late response! I was thinking about a pro tier for this kind of specialized stuff. Core stays MIT forever, but fintech tooling could be paid. Of the chart types you listed, is there a preference for what gets done first? Order Book Heatmaps first?

No problem :) I asked a friend who's a bit closer to the space and he agrees, definitely Order Book Heatmaps. The speed you're getting would make this a killer feature. Competitors typically have to snapshot/aggregate because their graphing libraries are heavily CPU bound. Being able visualise level 2/3 data without downsampling is a big win. Also being able to smoothly roll back through the last 12hrs of tick-level…

hunter that's why your licensing is super important. If you don't lock it down you are doing free R&D for giant firms who have the money to make you, but will just rip you off if they can. I speak from extensive OSS experience. The feelgood of giving away wears off, make the right choices with regard to IP and you can capture the value you are creating for people who use it.

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#218

Earlier quoted context omitted.

Look up trasnferable objects, it's not new. The fetch api can get you ArrayBuffers that you can shuffle around zero copy, besides to webgl buffers, also to web workers. But minimizing copying or avoiding format conversions doesn't necessarily get you best performance of course.

I had a look, that certainly looks like part of the solution, now I need to get that array buffer from my backend into the browser runtime transferable object.

That's the fetch api part. https://developer.mozilla.org/en-US/docs/Web/API/Response/ar...

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#219

Earlier quoted context omitted.

I had a look, that certainly looks like part of the solution, now I need to get that array buffer from my backend into the browser runtime transferable object.

That's the fetch api part. https://developer.mozilla.org/en-US/docs/Web/API/Response/ar...

I tried it out, fetching i8 arrays from a localhost server, sending to webgpu and rendering the waveform. Wow, faster than I expected, 2 billion points/sec.

Re: Show HN: ChartGPU – WebGPU-powered charting library (1M points at 60fps)

#220
post #216

Earlier quoted context omitted.

Wait, does additional blending let you draw to temp framebuffers with high precision and without clamping? Even so you'd still need to know the maximum value of the temp framebuffer though.

That's what EXT_float_blend does. It's true, though, that you can't find the global min/max in webgl2. This could be done, theoretically, with mipmaps if only those mipmaps supported the max function.

Couldn't you do that manually with a simple downscaling filter? I'd be very shocked if fragment shaders did not have a min or max function.

Repeatedly shrinking by a factor of two means log2(max(width, height)) passes, each pass is a quarter of the pixels of the previous pass so that's a total of 4/3 times the pixels of the original image. Should be low enough overhead, right?

Post reply on HN