news · Barcelona

Rendering ten billion points without melting the browser

Rendering ten billion points without melting the browser

Rendering ten billion points without melting the browser

XY is a Python charting library that wants to draw the kind of data the rest of the toolchain has given up on. Where most charting libraries thin out or freeze past a few hundred thousand points, XY's core is written in Rust and only renders what the screen actually needs at its current resolution. Pan, zoom, hover, and selection run the same process on the new range, and a selection returns the original rows. The demo that makes the point is blunt: it renders the whole of OpenStreetMap — a ten billion point dataset.

It straddles two worlds. Charts are composed declaratively, or through matplotlib conventions, so people with existing pyplot code can just swap the import and keep their plotting. A chart is a container plus the marks inside it; any sequence works and NumPy is optional. Small charts send every point to the browser. Large ones lean on the Rust core to stay interactive.

The same API scales to a hundred million points drawn as a density surface — a scatter of 100,000,000 points shaped by a beta distribution, colored by a magma colormap, still live and zoomable. That is not a screenshot of a pre-baked image. It is a live chart you can scrub through.

The interesting part is the gap it closes. There has always been a fork in the road between data-viz libraries for everyday plots and the heavy machinery needed for custom large-scale visuals. XY is an attempt to have one library do both: build the chart once, then use it in notebooks, in web apps, or export it to HTML, PNG, SVG, or PDF from the same code.

Source: Reflex's XY project announcement (github.com/reflex-dev/xy), surfaced via Hacker News.