Version 5.0.0
What's Changed
- Update Vega-Lite from version 4.17.0 to version 5.8.0; see Vega-Lite Release Notes.
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 likealtair_saver
does (#2701). Currently,altair_saver
does not support Altair 5 and it is recommended to switch tovl-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
to300
(#2785). - Ordered pandas categorical data are now automatically encoded as sorted ordinal data (#2522)
- The
Title
andImpute
aliases were added forTitleParams
andImputeParams
, 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 requirespyarrow>=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 defaulthtml
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 usealt.X(...).bin(...)
) (#2795). See Method-Based Syntax for details. selection_single
andselection_multi
are now deprecated; useselection_point
instead. Similarly,type=point
should be used instead oftype=single
andtype=multi
.add_selection
is deprecated; useadd_params
instead.- The
selection
keyword argument must in many cases be replaced byparam
(e.g., when specifying a filter transform). - The
empty
keyword argument for a selection parameter should be specified asTrue
orFalse
instead ofall
ornone
, respectively. - The
init
keyword argument for a parameter is deprecated; usevalue
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 beselection
, but that usage is not compatible with the current Vega-Lite schema. - Removed the
altair.sphinxext
module (#2792). Thealtair-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
- @robna made their first contribution in #2559
- @tempdata73 made their first contribution in #2652
- @Ckend made their first contribution in #2667
- @brahn made their first contribution in #2681
- @jonmmease made their first contribution in #2701
- @hebarton5 made their first contribution in #2607
- @dwootton made their first contribution in #2719
- @johnmarkpittman made their first contribution in #2747
- @yanghung made their first contribution in #2621
- @daylinmorgan made their first contribution in #2686
- @xujiboy made their first contribution in #2615
- @Midnighter made their first contribution in #2466
- @dylancashman made their first contribution in #2925
- @dpoznik made their first contribution in #3001
- @m-charlton made their first contribution in #3026
- @nlafleur made their first contribution in #2867
- @kunalghosh made their first contribution in #3046
Release Notes by Pull Request
Click to view all 203 PRs merged in this release
- Add strict option to sphinx extension by @jtilly in #2551
- docs: correcting regression equations by @robna in #2559
- MAINT: Fix GH actions issues by @joelostblom in #2567
- WIP: update to Vega-Lite 5.2 by @ChristopherDavisUCI in #2528
- MAINT: Update actions' links to use https by @joelostblom in #2575
- DOCS: Clarify steps in the contributing guidelines by @joelostblom in #2569
- MAINT: Make sure that deprecation warnings are displayed by @joelostblom in #2577
- DOCS: Revamp docs for the 5.0 release by @joelostblom in #2566
- Pin selenium to avoid doctest breakage from deprecation by @joelostblom in #2624
- Remove broken Wikipedia donations chart by @palewire in #2625
- Tidy Falkensee case study by @palewire in #2626
- Tidy up U.S. Population by Age and Sex case study by @palewire in #2628
- Move bar chart with highlighted segment chart into the bar charts section by @palewire in #2630
- No need to say "Example" in the example headline by @palewire in #2631
- Isotype charts aren't case studies and should go in the other category by @palewire in #2632
- Top k charts aren't case studies and should go with other charts by @palewire in #2633
- Add pyramid pie chart to case studies by @palewire in #2635
- Move image tooltip example to interactive charts section by @palewire in #2636
- Move window rank technique to line charts section by @palewire in #2637
- Style fix to chart headline by @palewire in #2639
- Move scatter with histogram into scatter plots section by @palewire in #2641
- Clean up airport maps by @palewire in #2634
- Example of a line chart with a label annotating the final value by @palewire in #2623
- Update ranged_dot_plot.py by @palewire in #2642
- Tidy natural_disasters.py example by @palewire in #2643
- Create a new tables section by @palewire in #2646
- Tidy multiple_marks.py by @palewire in #2640
- docs: Fix a few typos by @timgates42 in #2649
- Create a new advanced calculations section of the example gallery by @palewire in #2647
- Tidy line chart examples by @palewire in #2644
- MAINT: Update examples and tests to VL5 syntax by @joelostblom in #2576
- formatted rst list correctly by @tempdata73 in #2652
- Added argmax example by @tempdata73 in #2653
- Change naming to alt.param and alt.add_params by @ChristopherDavisUCI in #2656
- minor: update readme code by @Ckend in #2667
- use 'UndefinedLike = Any' as the type hint by @brahn in #2681
- Add gallery example for empirical cumulative distribution function by @binste in #2695
- MAINT: Replace
iteritems
withitems
by @joelostblom in #2683 - Lifting parameters to the top level by @ChristopherDavisUCI in #2702
- Clarify that a special field name is required to render images in tooltips by @joelostblom in #2570
- Integrate vl-convert for saving to svg and png by @jonmmease in #2701
- Documentation for each mark type by @hebarton5 in #2607
- Include marks in sidebar/TOC by @mattijn in #2709
- use default projection from vegalite by @mattijn in #2710
- Geoshape docs revamp 5.0 by @mattijn in #2699
- fix reference geoshape.rst to index.rst and some typos by @mattijn in #2711
- Create new sections in the gallery for distributions and uncertainties and trend charts by @binste in #2706
- Update docs styling based on the new pydata template by @joelostblom in #2716
- Fix missing 's' from filename in quick start by @dwootton in #2719
- Revert undefinedlike by @mattijn in #2717
- Fix some formatting issues by @binste in #2722
- Improve documentation titles by @binste in #2721
- Make vl-convert saving work when the data server is enabled by @joelostblom in #2724
- Add toggle to hidden code snippets by @joelostblom in #2725
- MAINT: Update from v4 to v5 in some additional files by @joelostblom in #2582
- Fix syntax for with statement in _spec_to_mimebundle_with_engine by @binste in #2734
- Various smaller updates to documentation (harmonizing title cases, vega version numbers, browser compatibility, ...) by @binste in #2737
- Improve mark type sections by @binste in #2720
- Fix cut off property tables by @binste in #2746
- Update _magics.py by @johnmarkpittman in #2747
- Add waterfall chart example by @yanghung in #2621
- Run tests with Python 3.11 by @binste in #2757
- Improve waterfall example by @binste in #2756
- Improve encoding section by @binste in #2735
- documentation on spatial data by @mattijn in #2750
- Address Sphinx warnings by @binste in #2758
- fix(#2675): replace entrypoints with importlib.metadata by @daylinmorgan in #2686
- DOC: add dendrogram example by @xujiboy in #2615
- fix: remove duplicate / by @domoritz in #2262
- Clarify that not all channels accept additional options by @binste in #2773
- Consolidate docs and add section on Large Datasets by @binste in #2755
- fix: remove webdriver default argument to save by @Midnighter in #2466
- Fix docs for mobile devices by @binste in #2778
- Merge data pages again by @binste in #2781
- Update github actions by @binste in #2780
- enh: remove slash from base_url instead of html_template by @mattijn in #2782
- Test vl-convert engine in chart.save test by @jonmmease in #2784
- Fix altair test save if vl-convert-python is installed and altair_saver is not by @binste in #2786
- Remove update_subtraits as not used anywhere by @binste in #2787
- Run tests for both save engines altair_saver and vl-convert-python by @binste in #2791
- move tests and sphinxext outside folder application code by @mattijn in #2792
- Add method-based attribute setting by @ChristopherDavisUCI in #2795
- Modify generator to move autogenerated test to tests folder by @mattijn in #2804
- Disable uri-reference format check in jsonsschema by @binste in #2771
- Aliases for ImputeParams and TitleParams by @ChristopherDavisUCI in #2732
- Update and simplify README by @binste in #2774
- Add --check to black test command by @binste in #2815
- Add test for layer properties by @ChristopherDavisUCI in #2811
- docs: Use SVG thumbnail for emoji example and use VlConvert to build docs on CI by @jonmmease in #2809
- Dynamically determine jsonschema validator by @binste in #2812
- Change default chart width from 400 to 300 by @binste in #2785
- Add inline argument to chart.save() for html export by @jonmmease in #2807
- Remove side-effects of calling EncodingChannelMixin.to_dict by @binste in #2813
- WIP Parameter tests by @ChristopherDavisUCI in #2828
- Add missing object attributes to dir by @binste in #2831
- Clean up development and documentation requirements by @binste in #2830
- Add title section to customization page by @palewire in #2838
- Fix disable_debug_mode by @binste in #2851
- Remove vegalite v3 and v4 wrappers by @binste in #2847
- Remove vega v5 wrappers by @mattijn in #2829
- Represent pandas ordered categoricals as ordinal data by @joelostblom in #2522
- Add documentation for remaining config methods by @binste in #2853
- Reformat code base with black version 23 and restrict version by @binste in #2869
- Fix Altair import in tools scripts by @binste in #2872
- Hide deprecated callables from code completion suggestions by @binste in #2814
- Add changelog entries for 5.0 by @joelostblom in #2859
- Remove deep validation and instead use error hierarchy to improve error messages by @binste in #2842
- Make layer warnings clearer by @joelostblom in #2874
- Update Large Datasets documentation with VegaFusion 1.0 information by @jonmmease in #2855
- Add return type hints to improve code completion suggestions by @binste in #2846
- Apply minor code formatting change in tools script by @binste in #2881
- Expand mark spec when using to_dict by @joelostblom in #2823
- Report filename of failing test by @ChristopherDavisUCI in #2889
- Use most specific class possible in schema validation errors by @binste in #2883
- Add announcement to docs by @mattijn in #2891
- exclude
altair_saver
inbuild.yml
as Github Actions tests are not passing anymore by @mattijn in #2893 - Remove the automatic sort of categoricals for channels that do not support sorting by @joelostblom in #2885
- Add Heat Lane example by @palewire in #2882
- Support DataFrame Interchange Protocol (allow Polars DataFrames) by @ChristopherDavisUCI in #2888
- Parse shorthand when creating the condition 2 by @ChristopherDavisUCI in #2841
- Fix wrong json schema url in a test by @binste in #2898
- Apply minor change from #2841 in correct tools script by @binste in #2899
- Fix minor formatting issues in documentation by @binste in #2897
- No longer use deprecated SelectableGroups dict interface of entry points by @binste in #2900
- Add instructions on how to install release candidate by @binste in #2902
- Add missing attribute descriptions by @binste in #2892
- Rename 'Attributes' to 'Parameters' to fix documentation formatting by @binste in #2901
- Docstring links class transform and mark methods by @mattijn in #2912
- ENH: Make the schema validation error for non-existing params more informative by @joelostblom in #2568
- Make error messages on typos and missing/incorrect data types more informative by @joelostblom in #2824
- Include
alt.ExprRef
capabilities inalt.expr()
by @mattijn in #2886 - Move change introduced in #2824 to tools script by @binste in #2921
- MAINT: Remove inheritance from object for classes by @binste in #2922
- Update parameter docstrings and signatures by @ChristopherDavisUCI in #2908
- Update from Vega-Lite 5.2.0 to 5.6.1 by @ChristopherDavisUCI in #2871
- Deprecating selection by @ChristopherDavisUCI in #2923
- Improve autocompletion for arguments to objects wrapped with use_signature by @binste in #2920
- Update docs to better describe how to use checkboxes and logic-based bindings in general by @joelostblom in #2926
- Fix test_schema_validator_selection for jsonschema<4 by @binste in #2931
- Add more information about how to handle the max rows error by @palewire in #2840
- Fix deprecation warning for SelectableGroup in Python 3.7 by @binste in #2932
- include deprecation message in docstring by @mattijn in #2930
- use selection_point or selection_interval syntax by @mattijn in #2929
- Expand and document support for column names with special characters by @joelostblom in #2905
- Fix a few remaining ocurrences of
type=
by @joelostblom in #2933 - docs: Make rendering optional for tutorial by @dylancashman in #2925
- include section on expressions for interaction by @mattijn in #2928
- Add missing pandas import in docs by @joelostblom in #2934
- fix docstrings errors by @mattijn in #2936
- include issue in announcement by @mattijn in #2938
- Add vega themes 'excel', 'googlecharts', 'powerbi' by @binste in #2943
- Docs: Fix formatting of 2 links by @binste in #2942
- Apply changes of #2931 in tools folder by @binste in #2941
- Fail build workflow if generate_schema_wrapper produces changes by @binste in #2940
- Update resource section by @joelostblom in #2415
- Shorten page title by @joelostblom in #2946
- Remove $ from bash examples on installation page by @palewire in #2962
- Slight edits and trims to the overview page by @palewire in #2961
- Include all options in enum error messages by @binste in #2957
- Type hints: Improve for encoding channel attributes by @binste in #2949
- Simplify and clean up tool folder by @binste in #2944
- Temporarily use default data transformer while saving a chart by @binste in #2954
- Cut dependencies from installation page by @palewire in #2964
- Type hints: Add static type checker mypy by @binste in #2950
- Maintenance: Remove test_schemapi.py in tools folder by @binste in #2973
- Deduplicate error messages by @binste in #2975
- Move disclaimer to the bottom of the index page by @palewire in #2960
- Consolidate naming history into overview by @palewire in #2968
- Reduce line-height in the gallery thumbnail headlines by @palewire in #2969
- Add missing descriptions to tables created with altair-object-table by @binste in #2952
- Clean tests folder by @mattijn in #2974
- Trim that eliminates redundancy by @palewire in #2985
- Trim index page language by @palewire in #2970
- Add code copy button to docs by @joelostblom in #2984
- Clarify differences between pandas and other dataframe packages by @joelostblom in #2986
- Use more idiomatic
stroke
option by @joelostblom in #2992 - Display more helpful error message when two fields strings are used in condition by @joelostblom in #2979
- Restructure and clarify interactive docs by @joelostblom in #2981
- Simplify syntax by @joelostblom in #2991
- Sync
selection_*
docstrings with signatures by @dpoznik in #3001 - Prefer method-based syntax in docs and add tabbed interface for method and attribute syntax in gallery by @joelostblom in #2983
- Fix a few doc build warnings by @joelostblom in #3004
- use
ruff
as linter by @mattijn in #3008 - remove deprecated datasets.py by @mattijn in #3010
- fix writing svg to file including emojis by @mattijn in #3015
- Simplify package mangement by @mattijn in #3007
- Update from Vega-Lite 5.6.1 to 5.7.1 by @binste in #3022
- Categories transposed in data documentation by @m-charlton in #3026
- Fix typo in docs causing code blocks to not render by @joelostblom in #3029
- include underscore after view by @mattijn in #3030
- include view definitions for a layercharts containing a repeat + toplevel selection parameter by @mattijn in #3031
- Improve readme by @mattijn in #3033
- Improve error prioritisation and messages by @binste in #3009
- Enhancement of Vega-Embed CSS for Improved Display and Flexibility by @nlafleur in #2867
- update vega expressions options by @mattijn in #3034
- re-include interactive_layered_crossfilter by @mattijn in #3036
- Update from Vega-Lite 5.7.1 to 5.8.0 by @mattijn in #3037
- Increase minimum required jsonschema (
>=4.0.01
) by @mattijn in #3039 - Add info that altair_saver does not yet support Altair 5 by @binste in #3042
- geopandas.datasets is deprecated by @mattijn in #3043
- reintroduce support
jsonschema>=3.0
by @mattijn in #3044 - Update core.py by @kunalghosh in #3046
- update display.py, fix broken link by @mattijn in #3047
Full Changelog: v4.2.0...v5.0.0