VegaFusion provides server-side acceleration for the Vega visualization grammar, primarily designed to enhance Python libraries like Altair. It enables scaling interactive charts to large datasets by offloading data transformations from the browser to an efficient, multi-threaded Rust-based Python kernel. The library is currently at version 2.0.3 and maintains an active development and release cadence.
pip install vegafusion altairVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to enable VegaFusion for Altair visualizations. As of VegaFusion 2.0, the integration is handled by enabling Altair's built-in 'vegafusion' data transformer. This allows Altair charts to automatically offload data-intensive operations to the VegaFusion backend.
Instead of `import vegafusion as vf; vf.enable()`, use `import altair as alt; alt.data_transformers.enable('vegafusion')`. For saving or extracting transformed data, use Altair's native `chart.save()` or `chart.to_dict()` methods after enabling the transformer.Ensure Altair is updated to `altair>=5.5.0` using `pip install altair>=5.5.0`.
Review your data handling. If you require `pandas` or `pyarrow` for other parts of your workflow, ensure they are still installed. VegaFusion 2.0 supports any Narwhals-compatible DataFrame type or objects supporting the Arrow PyCapsule interface for zero-copy data transfer.
Customize VegaFusion's local timezone using `vegafusion.set_local_tz("Your/Timezone")` at the beginning of your session to ensure consistent time interpretation.