Skip to content

Version 5.0.0

Compare
Choose a tag to compare
@mattijn mattijn released this 09 May 15:04

What's Changed

Enhancements

  • As described in the release notes for Vega-Lite 5.0.0, the primary change in this release of Altair is the introduction of parameters. There are two types of parameters, selection parameters and variable parameters. Variable parameters are new to Altair, and while selections are not new, much of the old terminology has been deprecated. See Slider Cutoff for an application of variable parameters (#2528).
  • Grouped bar charts and jitter are now supported using offset channels, see Grouped Bar Chart with xOffset and Strip Plot Jitter.
  • vl-convert is now used as the default backend for saving Altair charts as svg and png files, which simplifies saving chart as it does not require external dependencies like altair_saver does (#2701). Currently, altair_saver does not support Altair 5 and it is recommended to switch to vl-convert. See PNG, SVG, and PDF format for more details.
  • Saving charts with HTML inline is now supported without having altair_saver installed (#2807).
  • The default chart width was changed from 400 to 300 (#2785).
  • Ordered pandas categorical data are now automatically encoded as sorted ordinal data (#2522)
  • The Title and Impute aliases were added for TitleParams and ImputeParams, respectively (#2732).
  • The documentation page has been revamped, both in terms of appearance and content.
  • More informative autocompletion by removing deprecated methods (#2814) and for editors that rely on type hints (e.g. VS Code) we added support for completion in method chains (#2846) and extended keyword completion to cover additional methods (#2920).
  • Substantially improved error handling. Both in terms of finding the more relevant error (#2842), and in terms of improving the formatting and clarity of the error messages (#2824, #2568, #2979, #3009).
  • Include experimental support for the DataFrame Interchange Protocol (through __dataframe__ attribute). This requires pyarrow>=11.0.0 (#2888).
  • Support data type inference for columns with special characters (#2905).
  • Responsive width support using width="container" when saving charts to html or displaying them with the default html renderer (#2867).

Grammar Changes

  • Channel options can now be set via a more convenient method-based syntax in addition to the previous attribute-based syntax. For example, instead of alt.X(..., bin=alt.Bin(...)) it is now recommend to use alt.X(...).bin(...)) (#2795). See Method-Based Syntax for details.
  • selection_single and selection_multi are now deprecated; use selection_point instead. Similarly, type=point should be used instead of type=single and type=multi.
  • add_selection is deprecated; use add_params instead.
  • The selection keyword argument must in many cases be replaced by param (e.g., when specifying a filter transform).
  • The empty keyword argument for a selection parameter should be specified as True or False instead of all or none, respectively.
  • The init keyword argument for a parameter is deprecated; use value instead.

Bug Fixes

  • Displaying a chart not longer changes the shorthand syntax of the stored spec (#2813).
  • Fixed disable_debug_mode (#2851).
  • Fixed issue where the webdriver was not working with Firefox's geckodriver (#2466).
  • Dynamically determine the jsonschema validator to avoid issues with recent jsonschema versions (#2812).

Backward-Incompatible Changes

  • Colons in column names must now be escaped to remove any ambiguity with encoding types. You now need to write "column\:name" instead of "column:name" (#2824).
  • Removed the Vega (v5) wrappers and deprecate rendering in Vega mode (save Chart as Vega format is still allowed) (#2829).
  • Removed the Vega-Lite 3 and 4 wrappers (#2847).
  • Removed the deprecated datasets.py (#3010).
  • In regards to the grammar changes listed above, the old terminology will still work in many basic cases. On the other hand, if that old terminology gets used at a lower level, then it most likely will not work. For example, in the current version of Scatter Plot with Minimap, two instances of the key param are used in dictionaries to specify axis domains. Those used to be selection, but that usage is not compatible with the current Vega-Lite schema.
  • Removed the altair.sphinxext module (#2792). The altair-plot Sphinx directive is now part of the sphinxext-altair package.

Maintenance

  • Vega-Altair now uses hatch for package management.
  • Vega-Altair now uses ruff for linting.

New Contributors

Release Notes by Pull Request

Click to view all 203 PRs merged in this release

Full Changelog: v4.2.0...v5.0.0