Urgent.News

What's breaking now, across thousands of outlets.

Tech

Reflex’s Newly Open-Sourced XY Library Offers Faster Python Charting

A newly open-sourced Python charting library, called XY, from Reflex offers an advantage few other charting tools provide: massive scalability. The library rethinks how to render a set of points on the computer screen, and opens new possibilities for using charts in daily workflows. Most Python charting libraries today, such as Plotly, Bokeh, or Matplotlib, […]

Reflex’s Newly Open-Sourced XY Library Offers Faster Python Charting

Reflex has recently released an open-source Python charting library named XY, which promises to revolutionize the way charts are rendered on the web. Unlike other popular charting libraries such as Plotly, Bokeh, and Matplotlib, XY takes a unique approach to handling data, potentially offering unprecedented scalability and performance.

The key innovation lies in the rendering process. Instead of sending every single data point to the browser for parsing, XY offloads the heavy lifting to Rust-built libraries. This allows the library to match the rendering job to the pixel/density surface of the screen, ensuring optimal performance regardless of the number of points being plotted.

By keeping chart values in a ColumnStore format and computing the level of detail via Rust-compiled libraries, XY efficiently sends only the necessary data to the screen. This results in significant memory savings and maintains rendering times around 80 milliseconds, irrespective of the data size – from 10,000 to 10 million points.

One of the most striking features of XY is its dynamic nature. Users can easily zoom into specific regions of a chart, and the software will automatically recalculate and update the displayed area, allowing for drilling down to individual data points. Reflex has made XY a drop-in replacement for Matplotlib workflows, meaning existing charts in the pyplot format can be seamlessly rerendered with XY.

The current release of XY focuses on two-dimensional charts and doesn't support polar or 3D charts. However, the ability to quickly render large datasets opens up new possibilities for real-time data visualization and dashboarding. The library's chart.append() method enables updates to existing charts, facilitating live data connections without the need for a complete rebuild.

Furthermore, XY supports sharing charts as stand-alone interactive files. A 10-million-point interactive scatter chart exports to a mere 258 KiB of HTML, making it compact enough for email attachment. In comparison, the equivalent Plotly chart would be 259 MiB. XY can handle various data types, including time series data like telemetry, market tick data, and log-derived metrics. The library ensures that all spikes and drops in time series data are rendered and responsive to zooming.

Installing XY is straightforward, with users able to install it via `pip install XY` or `uv add XY`, depending on their preferred package manager. Once imported into Python code, data can be added through a Python container, and NumPy may or may not be utilized for this purpose.

Lastly, XY can be integrated into Reflex, Reflex's open-source Python-based Web framework, allowing for easy incorporation into web applications without the need for JavaScript, iframes, or separate chart services.

Written by urgent.news from DevOps.com's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at devops.com →

More in Tech

Hello World!

SELECT * FROM felipe; 👋 Sou Felipe Gabriel , Analista de BI e Dados com +6 anos de experiência transformando dado bruto em decisão.

More from Thursday 13 August →