Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi,

First of all, what an excellent library! I have been looking for something like this for a long time.

I'm looking into the possibility of hot-loading new data (in my case, from Clikchouse) when zooming in on the data. Clickhouse supports various output formats like Arrow Stream (https://clickhouse.com/blog/streaming-real-time-visualizations-clickhouse-apache-arrow-perpsective) that might be useful. Essentially, I want to do something similar to this Clickhouse demo:

https://adsb.exposed/?dataset=Planes&zoom=2&lat=18.1504&lng=88.5938&query=11aea631085a55a6bc0f9b574d7b6c16

Any ideas, pointers to or examples on how this could be done?

You must be logged in to vote

Replies: 1 comment · 6 replies

Comment options

Hi thanks for posting. How big are your datasets? If it fits into GPU RAM the easiest thing is to just have everything on the GPU, I guess unlike many plotting libraries wgpu can actually handle this, for example: pygfx/pygfx#819

If they are too large to fit into RAM we can guide you to some creative solutions based on what exactly you're trying to visualize.

You must be logged in to vote
6 replies
@kushalkolar
Comment options

Nice! For an orthographic projection like this you could determine the currently viewable extent of the scene similar to how axes ranges are set dynamically: https://github.com/fastplotlib/fastplotlib/blob/main/fastplotlib%2Fgraphics%2F_axes.py#L401

Zoom isn't a reliable way to do it I think.

Once you have the extent, you could use different subsample levels for a few different scales of extent ranges. This would be some kind of basic LOD system I think. @almarklein might have a better idea.

Would need more thought to extend this to perspective projections.

@almarklein
Comment options

I think with this kind of data we assume an orthographic projection (i.e. fov==0).

Zoom isn't a reliable way to do it I think.

The camera.zoom property is indeed not a good measure; that one is intended for quick temporary zooming. I admit this is a bit confusing...

The current "zoom level" of the camera is defined by its .width and .height properties. In time-series-like data like this, just using .width makes the most sense for this use-case. The .width together with the camera's .world.position.x determines what part of the x-axis is in view.

@almarklein
Comment options

Super-cool use-case BTW 🤘

@arniwesth
Comment options

I ended up essentially replicating the Clikchouse demo. The SQL from the demo outputs an image as a result, so it is very easy to render using fastplotlib, and it creates some nice-looking graphs:

Screenshot 2025-05-31 at 12 42 43

I also turned it into an animation, using the Simple Image Update example, and made a post on it here (trying to promote fastplotlib a bit🙂).

@kushalkolar
Comment options

The animation function will render continuously which will have a performance impact by constantly updating the buffer, unless you put in condition to update only when there's significant changes in the current extent. If you post your animation function I can take a look.

Cool post, thanks for sharing! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.