Altair v4.0.0 Release Notes

Release Date: 2019-12-11 // over 4 years ago
  • ๐Ÿš€ Altair Version 4.0.0 release

    ๐Ÿ”– 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.

    โœจ Enhancements

    ๐Ÿ‘Œ 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

    Image mark (Example)
    image

    ๐Ÿ†• 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

    Grammar Changes

    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.