Skip to content

Use "vegafusion" data transformer in Altair 5.1 instead of vf.enable() #1

@jonmmease

Description

@jonmmease

This course looks great!

We're working on moving VegaFusion's Altair integration into Altair itself, and as of Altair 5.1 the functionality of vf.enable() can be replaced by:

alt.data_transformers.enable("vegafusion")

This avoids the need to import VegaFusion separately, and is what is now recommended in the Altair documentation: https://altair-viz.github.io/user_guide/large_datasets.html#vegafusion-data-transformer. It will also cause Altair to invoke VegaFusion when saving charts with chart.save() (replacing VegaFusion's vf.save_* functions).

The full interactive functionality of vf.enable_widget() isn't integrated into Altair yet, so for now vf.enable_widget() is still the best approach for use cases that involve interactive filtering of large datasets.

Another Altair 5.1 feature that might be useful for teaching is the new chart.transformed_data() method. This uses VegaFusion to make it possible to access the transformed data from a chart as a pandas DataFrame. It doesn't support every transform type yet, but it's already pretty useful for inspecting what most of the common transforms do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions