HeadlinesBriefing favicon HeadlinesBriefing.com

XY: Fast Python Charts for Web & Notebooks

Hacker News •
×

XY is a new Python charting library designed for speed and flexibility, capable of rendering interactive, customizable charts for web applications, notebooks, and static exports. It uses a Rust core for GPU acceleration, optimizing rendering for datasets of all sizes. For large datasets, it computes only the necessary data for the visible screen area, significantly improving performance. For instance, XY successfully rendered the entirety of Open Street Map, a 10 billion point dataset.

Installation is straightforward via pip (`pip install xy`). The library offers a declarative API, but also supports familiar Matplotlib conventions. Charts can be customized using Python, CSS, or Tailwind. XY is currently in alpha, with frequent updates planned. It aims to be a single solution for Python users needing to create everything from simple plots to complex visuals for applications and large-scale data analysis.

Benchmarks show XY significantly outperforming libraries like Matplotlib and Plotly in rendering speed, especially with large datasets. For example, at 100 million points, XY renders in 0.081 seconds, while Matplotlib takes 13.385 seconds and Plotly reaches 9.794 seconds. This performance is achieved by rendering a screen-bounded density surface for large datasets and efficiently handling zoom and pan operations. XY also integrates seamlessly with the Reflex Python web framework.