--- date: 2024-11-13 category: Release author: Jon Mease --- # VegaFusion 2.0 **A new era: Building blocks for analyzing, accelerating, and scaling Vega visualizations:** By: Jon Mease --- The VegaFusion team is excited to announce the release of VegaFusion 2.0. This major release represents a significant evolution in VegaFusion's architecture and target audience. The focus has been on simplification - making VegaFusion easier to maintain and easier to integrate into larger Vega systems to accelerate and scale Vega visualizations. ## Modernized Rust Core The core Rust implementation has been significantly simplified by taking advantage of modern DataFusion functionality: - New `get_column_usage()` utility function for analyzing the column dependencies of datasets in a Vega spec. - Custom User Defined Functions (UDFs) have been largely replaced with DataFusion's native capabilities. - Vega transforms are now implemented directly against the DataFusion DataFrame API, rather than using the circuitous SQL generation approach of VegaFusion 1. - Updated to DataFusion 43 and Arrow 52.3 for improved performance and bug fixes. ## JavaScript / WebAssembly The JavaScript integration has been simplified while maintaining full functionality: - Removed the separate `vegafusion-embed` package as the `vegafusion-wasm` package now renders charts using vega-embed. - The full VegaFusion runtime is now compiled to WebAssembly as part of the `vegafusion-wasm` pacakge, making it possible to run VegaFusion entirely in the browser without requiring an external server. - Connecting to external VegaFusion servers via gRPC-Web remains supported. ## Python: Removal of Upstreamed Vega-Altair Integration All the VegaFusion 1.x logic for integrating with Vega-Altair has been upstreamed into the Vega-Altair project itself. So this functionality has been removed in VegaFusion 2.0. In particular: - To use VegaFusion with Vega-Altair, activate the [`"vegafusion"` data transformer](https://altair-viz.github.io/user_guide/large_datasets.html#vegafusion-data-transformer). - The `vegafusion-jupyter` package has been retired in favor of using Altair's built-in `JupyterChart` for Altair charts and Vega-Lite specs. For Vega specs, the new [AnyWidget](https://anywidget.dev/)-based `VegaFusionWidget` is included in the `vegafusion` package. - `vf.enable()` has been removed. Instead, use the `"vegafusion"` data transformer along with any of Altair's built-in renderers - `vf.save()` has been removed. Instead, use Altair's native `chart.save()` method with the `"vegafusion"` data transformer enabeld. - `vf.transformed_data()` has been removed. Instead, use Altair's native `chart.transformed_data()` method. ## Python: Enhanced DataFrame Compatibility VegaFusion 2.0 brings improved DataFrame compatibility: - Support for any [Narwhals](https://narwhals-dev.github.io/narwhals/)-compatible DataFrame type as inline datasets. - Zero-copy sharing of Arrow data from Polars to VegaFusion's DataFusion runtime is now supported thanks to the [arro3](https://github.com/kylebarron/arro3) project.. - The DuckDB SQL connection has been removed, but DuckDB relations are now directly supported as inline datasets, with automatic column pruning prior to conversion to Arrow. - Reduced Python dependencies. VegaFusion now requires only [`arrow3-core`](https://pypi.org/project/arro3-core/), [`packaging`](https://pypi.org/project/packaging/), and [`narwhals`](https://pypi.org/project/narwhals/). In particular, `pyarrow` and `pandas` are no longer required dependencies. ## New Documentation VegaFusion 2.0 launches with completely revamped documentation: - New PyData Sphinx theme at [vegafusion.io](http://vegafusion.io/v2/) - Standalone examples in Python and Rust - Comprehensive support tables for Vega transforms and expressions ## Learn more Check out these resources to learn more: - [2.0.0 Changelog](https://github.com/hex-inc/vegafusion/releases/tag/v2.0.0) - [VegaFusion Documentation](https://vegafusion.io/v2) - [VegaFusion GitHub](https://github.com/hex-inc/vegafusion) - [Report and Issue](https://github.com/hex-inc/vegafusion/issues) - [Start a Discussion](https://github.com/hex-inc/vegafusion/discussions)