|

Reflex Open Sources XY: A Rust-Backed Super-Fast Python Charting Library That Keeps 100 Million Point Charts Interactive

Reflex AI has launched XY, an Apache-2.0 Python charting library for interactive 2D visualization. Most Python charting stacks create one drawable object per row, so previous just a few hundred thousand factors, render, hover, and zoom degrade. XY strikes the work right into a native Rust core, sends the browser typed binary buffers as an alternative of JSON, and attracts with WebGL2. In the phrases of the benchmark, XY holds 0.071 s at 10,000 factors and 0.081 s at 100 million. It ships as pip set up xy and requires Python 3.11 or newer.

Is it deployable

XY is early alpha at model 0.0.1. It ships as pip set up xy and requires Python 3.11 or newer.

That maps to a transparent deployment envelope. (*100*) and mid-size information groups can undertake it now for inside analytics, notebooks, and shareable artifacts. Regulated enterprises ought to pilot it moderately than put it on a customer-facing vital path. Fit is strongest the place row counts are the precise bottleneck: quantitative finance (tick information), genomics and bioinformatics (Manhattan plots, allele-frequency scans), observability and telemetry, astronomy, and geospatial analytics. Here is how one can set up it in 1 line.

Explainer

How the illustration ladder works

XY retains canonical f64 columns in a ColumnStore in Python and picks a rendered illustration per hint. Current defaults begin M4 decimation above 10,000 rows for lengthy ordered strains, and automated scatter density above 200,000 factors. Density grids default to 512×384 cells. The docs are specific that these are pre-1.0 coverage thresholds, not API ensures.

Because actual values keep in Python, hover, choice, and choose() nonetheless resolve unique rows when the energetic tier has an actual mapping. Zooming right into a slender window returns actual seen factors for a padded aligned window, and close by pans render from that cached window with out one other request. Reflex is cautious to not overclaim right here: density is natively binned and GPU-rendered, not an all-GPU ingest pipeline, and ingest, binning, and decimation nonetheless scale with supply row depend.

Performance

The benchmark drives each library via an actual browser and stops the clock solely when the canvas is verified right and steady throughout 10 byte-identical frames. Measurements come from one Apple M5 Pro, one run per cell.

Points XY Matplotlib (WebAgg) Plotly (scattergl)
1M 0.084 s 0.357 s 0.614 s
10M 0.083 s 2.804 s 3.367 s
50M 0.076 s 13.385 s
100M 0.081 s

That is a said 34× speedup at 10M and 177× at 50M. Peak Python-side reminiscence at 10M is 0.32 GiB for XY towards 0.84 GiB for Matplotlib and 1.86 GiB for Plotly. With density=False, XY nonetheless attracts 100M actual markers in 1.343 s on 5.26 GiB. Reflex additionally experiences rendering the complete OpenStreetMap dataset — 10 billion factors.

A 10-million-point interactive scatter exports to 258 KiB of HTML, versus a said 259 MiB for the Plotly equal. The payload stays close to 258 KiB from 1M via 100M rows.

API floor and integration

Charts are composed declaratively from marks, axes, legends, tooltips, and annotations. Fourteen chart households ship right this moment, together with scatter, line, space, histogram, field, violin, ECDF, heatmap, hexbin, and contour. Styling accepts CSS and Tailwind courses via steady DOM slots. For migration, import xy.pyplot as plt runs widespread Matplotlib pyplot code, although the compatibility guide notes not every part is supported. A separate reflex-xy adapter turns any chart right into a Reflex part with no JavaScript or iframe.

Key Takeaways

  • XY holds ~0.08 s render time from 10k to 100M factors by drawing screen-bounded representations, not per-row markers.
  • Rust core plus binary transport cuts a 10M-point interactive export to 258 KiB towards Plotly’s 259 MiB.
  • Exact f64 columns keep in Python, so hover, choice, and zoom drilldown nonetheless return unique rows.
  • Deployable right this moment for notebooks, inside dashboards, and shareable HTML; model 0.0.1 alpha argues towards vital paths.
  • Best match is finance, genomics, telemetry, and astronomy, the place sampling earlier than plotting is the present default.


Check out the GitHub Repo and Technical detailsAlso, be happy to observe us on Twitter and don’t overlook to hitch our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

Need to accomplice with us for selling your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar and many others.? Connect with us

The submit Reflex Open Sources XY: A Rust-Backed Super-Fast Python Charting Library That Keeps 100 Million Point Charts Interactive appeared first on MarkTechPost.

Similar Posts