Reflex Opens Sources XY: A Rust-Backed Super-Fast Python Charting Library
The new XY library version 0.0.1 requires Python 3.11+ and brings high-speed, interactive charting for datasets up to 100 million points.

Stock photo for illustration only, not from the actual event
- Reflex open-sources XY, a Rust-backed charting library built for Python.
- Delivers massive speedups over Matplotlib and Plotly, supporting up to 100M points.
- Consumes lower Python-side memory and exports tiny 258 KiB HTML payloads.
- Ships with 14 chart families and a compatibility adapter for migrating from Matplotlib.
Reflex has open-sourced a new library called XY, currently in early alpha at version 0.0.1, designed to eliminate performance bottlenecks when handling massive datasets. Powered under the hood by Rust, the library can be installed via pip install xy and requires Python 3.11 or newer to run.
Regarding deployment, XY fits best for startups and mid-size data teams looking for internal analytics, notebooks, and shareable artifacts. Regulated enterprises are advised to run pilot tests rather than placing it on customer-facing critical paths. Its utility shines brightest where row counts act as primary bottlenecks, such as quantitative finance with tick data, genomics and bioinformatics, observability and telemetry, astronomy, and geospatial analytics.
By leveraging Rust under the hood and maintaining canonical f64 columns in a Python ColumnStore, XY bypasses traditional Python performance constraints. This design exemplifies the modern trend in data science tooling: combining the raw computational speed of lower-level compiled languages with the flexibility of script environments to handle tens of millions of data points without browser unresponsiveness.
Internally, XY keeps exact values in Python and determines a rendered representation per trace. Current default behaviors trigger M4 decimation above 10,000 rows for long ordered lines and automatic scatter density above 200,000 points. Density grids default to 512×384 cells, which official documentation explicitly notes as pre-1.0 policy thresholds rather than permanent API guarantees.

Stock photo for illustration only, not from the actual event
Because exact values remain accessible in Python, hover interactions, selections, and the pick() method continue to resolve original rows whenever the active tier maintains an exact mapping. Zooming into a narrow window yields exact visible points from a padded aligned window, and nearby pans render directly from that cached window without triggering additional requests.
Benchmark measurements run through a real browser on a single Apple M5 Pro device show a stated 34× speedup at 10 million points and 177× at 50 million points. Peak Python-side memory usage at 10 million points reaches 0.32 GiB for XY, compared to 0.84 GiB for Matplotlib and 1.86 GiB for Plotly. When density is set to false, XY draws 100 million exact markers in 1.343 seconds using 5.26 GiB of memory. Reflex also highlights the successful rendering of the complete OpenStreetMap dataset comprising 10 billion points.
Export capabilities are equally striking: a 10-million-point interactive scatter plot exports to just 258 KiB of HTML, contrasted with a stated 259 MiB for the equivalent Plotly output. This payload size remains constant around 258 KiB across datasets ranging from 1 million to 100 million rows.

Stock photo for illustration only, not from the actual event
Charts are constructed declaratively using marks, axes, legends, tooltips, and annotations. Fourteen chart families are available out of the box, including scatter, line, area, histogram, box, violin, ECDF, heatmap, hexbin, and contour. Styling integrates cleanly with CSS and Tailwind classes through stable DOM slots. For migration purposes, importing xy.pyplot as plt enables running common Matplotlib pyplot syntax, though compatibility notices warn that full coverage is not guaranteed. Additionally, a separate reflex-xy adapter transforms any chart into a native Reflex component without requiring JavaScript or iframes.
Source: MarkTechPost
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment