strokeDash encoding can now be used to control line styles (Example: Multi Series Line Chart chart.save() now relies on altair_saver for more flexibility (#1943).chart.show() method replaces chart.serve(), and relies on altair_viewer to allow offline viewing of charts (#1988).π§ ##Maintenance
π Version 4.0.0 is based on Vega-Lite version 4.0, which you can read about at
π https://github.com/vega/vega-lite/releases/tag/v4.0.0.
β
It is the first version of Altair to drop Python 2 compatibility, and is tested
on Python 3.5 and newer.
π Support for interactive legends: (Example)
interactive legend
π± Responsive chart width and height: (Example)
dynamic width
π± Bins responsive to selections: (Example)
π± responsive bin
π New pivot transform: (Example)
pivot
π New Regression transform: (Example)
regression
π New LOESS transform: (Example)
loess
π New density transform: (Example)
density
π New default html renderer, directly compatible with Jupyter Notebook and
JupyterLab without the need for frontend extensions, as well as tools like
nbviewer and nbconvert, and related notebook environments such as Zeppelin,
0οΈβ£ Colab, Kaggle Kernels, and DataBricks. To enable the old default renderer, use:
alt.renderers.enable('mimetype')
π Support per-corner radius for bar marks: (Example)
round-bar
Sort-by-field can now use the encoding name directly. So instead of
alt.Y('y:Q', sort=alt.EncodingSortField('x_field', order='descending'))
you can now use::
alt.Y('y:Q', sort="-x")
π§ The rangeStep argument to :class:Scale and :meth:Chart.configure_scale is deprecated.
instead, use chart.properties(width={"step": rangeStep}) or
π§ chart.configure_view(step=rangeStep).
align, center, spacing, and columns are no longer valid chart properties, but
π are moved to the encoding classes to which they refer.