Altair

Latest version: v5.5.0

Safety actively analyzes 688178 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

5.5.0

The Vega-Altair team is pleased to announce the release of version 5.5.0. This version introduces several exciting new features and enhancements including a revamped theme system, a new renderer optimized for screen readers, and numerous type system updates that improve auto-completion and make it easier to integrate Altair into larger typed programs.

This release adds Python 3.13 and removes Python 3.8 support. It also includes a variety of documentation improvements and a range of important bug fixes.

Thanks to our maintainers (binste, dangotbanned, joelostblom, mattijn, and jonmmease), returning contributors (MarcoGorelli, daylinmorgan, and dsmedia), and first time contributors (jpn--, davidgroves, and apoorvkh) for these improvements.

What's Changed
Deprecation
alt.themes
This release deprecates the `alt.themes` `ThemeRegistry` object and replaces it with an improved theme API in the new `alt.theme` module. See the updated [Chart Themes](https://altair-viz.github.io/user_guide/customization.html#chart-themes) documentation for more information:

> [!NOTE]
> Usage of the legacy `alt.themes` registry will be supported until version 6, but will now display a warning on first use.

* Refactor `alt.themes` -> `alt.theme` by dangotbanned in [3618](https://github.com/vega/altair/pull/3618)
* Adds `register_theme` decorator by dangotbanned in [3526](https://github.com/vega/altair/pull/3526)
* Adds `ThemeConfig` (`TypedDict`) by dangotbanned in [3536](https://github.com/vega/altair/pull/3536)

Example of registering a custom theme
python
import altair as alt
import pandas as pd

data = pd.DataFrame({'x': [5, 3, 6, 7, 2],
'y': ['A', 'B', 'C', 'D', 'E']})

alt.theme.register("my_little_theme", enable=True)
def custom_theme():
return alt.theme.ThemeConfig(
config={
"bar":{"color":"black"}
}
)

chart = alt.Chart(data).mark_bar().encode(
x='x',
y='y',
)
chart enable default using `alt.theme.enable("default")`

<img src="https://hackmd.io/_uploads/rJ2miY1XJl.png" width="200">

Example of instant feedback while you define a theme config through Pylance in VSCode
<img src="https://hackmd.io/_uploads/SJ8Qi917Jx.gif" width="450">

Enhancements

Olli Renderer
This release integrates the [Olli](https://vis.csail.mit.edu/pubs/olli/) project to provide a chart renderer that augments chart visualizations with a keyboard-navigable structure accessible to screen readers.

* Add 'olli' renderer to generate accessible text structures for screen reader users by binste in [3580](https://github.com/vega/altair/pull/3580)

Example of `olli` renderer:
python
import altair as alt
from vega_datasets import data

alt.renderers.enable("olli")

cars = data.cars.url
chart = alt.Chart(cars).mark_bar().encode(
y='Cylinders:O',
x='mean_acc:Q'
).transform_aggregate(
mean_acc='mean(Acceleration)',
groupby=["Cylinders"]
)
chart

<img src="https://hackmd.io/_uploads/H1Cr9dJ7kl.png" width="555">

Expressions and Selections
Several improvements were made to Altair's [expression](https://altair-viz.github.io/user_guide/interactions/expressions.html) and [selection](https://altair-viz.github.io/user_guide/interactions.html#selections-capturing-chart-interactions) APIs:

* Generate `expr` method signatures, docs by dangotbanned in [3600](https://github.com/vega/altair/pull/3600)
* Support `&`, `|`, `~` on all `...Predicate` classes by dangotbanned in [3668](https://github.com/vega/altair/pull/3668)
* Support `datetime.(date|datetime)` in `Expression`(s) by dangotbanned in [3654](https://github.com/vega/altair/pull/3654)
* Support `datetime.(date|datetime)` as a `SchemaBase` parameter by dangotbanned in [3653](https://github.com/vega/altair/pull/3653)
* Add missing `float` to `IntoExpression` alias by dangotbanned in [3611](https://github.com/vega/altair/pull/3611)

Example of combining predicates within `.transform_filter`
python
import altair as alt
from vega_datasets import data

source = data.population.url
chart = alt.Chart(source).mark_line().encode(
x="age:O",
y="sum(people):Q",
color="year:O"
).transform_filter(
~alt.FieldRangePredicate(field='year', range=[1900, 1960])
& (alt.datum.age <= 70)
)
chart

<img src="https://hackmd.io/_uploads/B1e5TuJQyx.png" width="350">


Example of using Python `datetime.date` for `value` in `alt.selection_interval()`

python
import datetime
import altair as alt
from vega_datasets import data

source = data.unemployment_across_industries.url
dt_values = [datetime.date(2005, 1, 1), datetime.date(2009, 1, 1)]

brush = alt.selection_interval(
encodings=['x'],
value={"x": dt_values}
)

base = alt.Chart(source).mark_area(
color='goldenrod',
opacity=0.3
).encode(
x='yearmonth(date):T',
y='sum(count):Q',
)

background = base.add_params(brush)
selected = base.transform_filter(brush).mark_area(color='goldenrod')

background + selected

<img src="https://hackmd.io/_uploads/Sy29et1XJl.png" width="350">

Multiple `predicates` and `constraints` in `Chart.transform_filter`
* Support `Chart.transform_filter(*predicates, **constraints)` by dangotbanned in [3664](https://github.com/vega/altair/pull/3664)

Example of using keyword-argument `constraints` to simplify filter compositions:
python
import altair as alt
from vega_datasets import data

source = data.population.url
chart = alt.Chart(source).mark_line().encode(
x="age:O",
y="sum(people):Q",
color="year:O"
).transform_filter(year=2000, sex=1)
chart

<img src="https://hackmd.io/_uploads/rJvgGtkXJx.png" width="400">

Bug Fixes
* Resolve multiple `utils.use_signature` issues by dangotbanned in [3565](https://github.com/vega/altair/pull/3565)
* Relax `dict` annotations in `channels.py` by dangotbanned in [3573](https://github.com/vega/altair/pull/3573)
* Set charset=UTF-8 in HTML templates. by davidgroves in [3604](https://github.com/vega/altair/pull/3604)
* Replace unsafe `locals()` manipulation in `Chart.encode` by dangotbanned in [3637](https://github.com/vega/altair/pull/3637)
* Revise generated annotation order by dangotbanned in [3655](https://github.com/vega/altair/pull/3655)
* Resolve `alt.binding` signature/docstring issues by dangotbanned in [3671](https://github.com/vega/altair/pull/3671)
* Add missing `skip_requires_pyarrow(requires_tzdata=True)` by dangotbanned in [3674](https://github.com/vega/altair/pull/3674)
* Don't materialise Ibis table to PyArrow if using vegafusion data transformer by MarcoGorelli in [3566](https://github.com/vega/altair/pull/3566)
* `mypy` 1.12.0 errors by dangotbanned in [3632](https://github.com/vega/altair/pull/3632)
* Resolve warnings in `test_api.py` by dangotbanned in [3592](https://github.com/vega/altair/pull/3592)

Documentation
Several new examples were added to the documentation

Example of using `alt.when().then().otherwise()`
python
import altair as alt
from vega_datasets import data

source = data.cars()

brush = alt.selection_interval()

chart = alt.Chart(source).mark_point().encode(
x='Horsepower',
y='Miles_per_Gallon',
color=alt.when(brush).then("Origin").otherwise(alt.value("lightgray"))
).add_params(
brush
)
chart

<img src="https://hackmd.io/_uploads/BJA2tFk7kx.png" width="350">

Example of using luminance in an expression to dynamically colorize text
python
import altair as alt
from vega_datasets import data

source = data.barley()

base = alt.Chart(source).encode(
x=alt.X('sum(yield):Q').stack('zero'),
y=alt.Y('site:O').sort('-x'),
text=alt.Text('sum(yield):Q', format='.0f')
)

bars = base.mark_bar(
tooltip=alt.expr("luminance(scale('color', datum.sum_yield))")
).encode(
color='sum(yield):Q'
)

text = base.mark_text(
align='right',
dx=-3,
color=alt.expr("luminance(scale('color', datum.sum_yield)) > 0.5 ? 'black' : 'white'")
)

bars + text

<img src="https://hackmd.io/_uploads/r1-ydtkXJg.png" width="300">

* Unstack area to render cumulative chart correctly by joelostblom in [3558](https://github.com/vega/altair/pull/3558)
* Change remote nick to `origin` and capitalize version commit by joelostblom in [3559](https://github.com/vega/altair/pull/3559)
* Update releasing notes to reflect that main branch is now protected by binste in [3562](https://github.com/vega/altair/pull/3562)
* Split interactive docs section into subpages by joelostblom in [3561](https://github.com/vega/altair/pull/3561)
* Update docs to use correct init value for `selection_point` by jpn-- in [3584](https://github.com/vega/altair/pull/3584)
* Add example with overlapping bars in a grouped bar chart by mattijn in [3612](https://github.com/vega/altair/pull/3612)
* Bar chart with labels coloured by measured luminance by mattijn in [3614](https://github.com/vega/altair/pull/3614)
* Adds example Calculate Residuals by dangotbanned in [3625](https://github.com/vega/altair/pull/3625)
* Adds Vega-Altair Theme Test by dangotbanned in [3630](https://github.com/vega/altair/pull/3630)
* adds info with step size/independent scale by daylinmorgan in [3644](https://github.com/vega/altair/pull/3644)
* Fix "Layered chart with Dual-Axis" (Method syntax) by dangotbanned in [3660](https://github.com/vega/altair/pull/3660)
* Fix inaccurate `selection_interval` signature by dangotbanned in [3662](https://github.com/vega/altair/pull/3662)
* Update `selection_point` signature by dangotbanned in [3663](https://github.com/vega/altair/pull/3663)
* Update "Ranged Dot Plot" example by dangotbanned in [3665](https://github.com/vega/altair/pull/3665)
* Promote `when-then-otherwise` in User Guide by dangotbanned in [3544](https://github.com/vega/altair/pull/3544)
* Add initial date range to interval selection example by dsmedia in [3667](https://github.com/vega/altair/pull/3667)
* Generate docstrings for `mark_` methods by dangotbanned in [3675](https://github.com/vega/altair/pull/3675)
* Make plausible web analytics public and add link to maintainer notes by binste in [3571](https://github.com/vega/altair/pull/3571)
* Reduce `SchemaValidationError` traceback length by dangotbanned in [3530](https://github.com/vega/altair/pull/3530)

Maintenance
* Drop support for Python 3.8 by dangotbanned in [3647](https://github.com/vega/altair/pull/3647)
* Add support Python 3.13 by dangotbanned in [3591](https://github.com/vega/altair/pull/3591)
* Improve `Then` annotations, autocompletion, docs by dangotbanned in [3567](https://github.com/vega/altair/pull/3567)
* Resolve `SIM910` lint in `display.py` by dangotbanned in [3613](https://github.com/vega/altair/pull/3613)
* Add `typings/` to `.gitignore` by dangotbanned in [3560](https://github.com/vega/altair/pull/3560)
* Adds `test-(slow|fast)` options by dangotbanned in [3555](https://github.com/vega/altair/pull/3555)
* Remove `channels` parameter in `infer_encoding_types` by dangotbanned in [3564](https://github.com/vega/altair/pull/3564)
* Add include patterns for `pyright` by dangotbanned in [3583](https://github.com/vega/altair/pull/3583)
* Fix support `pylance>=2024.9.1` by dangotbanned in [3585](https://github.com/vega/altair/pull/3585)
* Bump `typing_extensions` python to `3.14` by dangotbanned in [3593](https://github.com/vega/altair/pull/3593)
* Future-proof Duration type error message test by MarcoGorelli in [3606](https://github.com/vega/altair/pull/3606)
* Use `breaking`, `deprecation` labels in changelog by dangotbanned in [3623](https://github.com/vega/altair/pull/3623)
* Bump `vl-convert-python` to `1.7.0` by dangotbanned in [3633](https://github.com/vega/altair/pull/3633)
* Add upper version bound on VegaFusion by jonmmease in [3638](https://github.com/vega/altair/pull/3638)
* Add untyped `vegafusion` to `mypy` overrides by dangotbanned in [3640](https://github.com/vega/altair/pull/3640)
* Remove outdated `schemapi` comment by dangotbanned in [3641](https://github.com/vega/altair/pull/3641)
* Support generating `Union` aliases by dangotbanned in [3656](https://github.com/vega/altair/pull/3656)
* Moved `vl-convert-python` to `save` dependency group by apoorvkh in [3609](https://github.com/vega/altair/pull/3609)
* Simplify `channels.py` overloads by dangotbanned in [3659](https://github.com/vega/altair/pull/3659)
* Use more robust dtype comparisons, use Narwhals stable API in tests by MarcoGorelli in [3670](https://github.com/vega/altair/pull/3670)
* Use duckdb instead of ibis to test interchange-only support by MarcoGorelli in [3672](https://github.com/vega/altair/pull/3672)
* Resolve or ignore `pyright`-only warnings by dangotbanned in [3676](https://github.com/vega/altair/pull/3676)
* Add `pyarrow-stubs` to `dev` dependencies by dangotbanned in [3679](https://github.com/vega/altair/pull/3679)
* Prep for VegaFusion 2.0 by jonmmease in [3680](https://github.com/vega/altair/pull/3680)
* Replace unconditional `typing_extensions` imports by dangotbanned in [3683](https://github.com/vega/altair/pull/3683)
* VegaFusion 2 will support narwhals by jonmmease in [3682](https://github.com/vega/altair/pull/3682)
* Bump narwhals to v1.13.1 by mattijn in [3690](https://github.com/vega/altair/pull/3690)
* Distinct Olli renderer template by mattijn in [3689](https://github.com/vega/altair/pull/3689)
* Fix ci warning for pivot.rst by mattijn in [3691](https://github.com/vega/altair/pull/3691)
* Correct nested `expr` equivalence by dangotbanned in [3624](https://github.com/vega/altair/pull/3624)


**Full Changelog**: https://github.com/vega/altair/compare/v5.4.1...v5.5.0

5.4.1

<!-- Release notes generated using configuration in .github/release.yml at v5.4.1 -->

What's Changed
Enhancements
* feat(typing): Generate `Literal` aliases in `channels` overload(s) by dangotbanned in https://github.com/vega/altair/pull/3535
* feat(typing): Generate `Literal`(s) using `"const"` by dangotbanned in https://github.com/vega/altair/pull/3538
Bug Fixes
* fix: Raise informative error message if a non-existent column name is passed by MarcoGorelli in https://github.com/vega/altair/pull/3533
* revert: Remove `sphinx` version constraint by dangotbanned in https://github.com/vega/altair/pull/3541
* fix: Pass native dataframe to data transformers by MarcoGorelli in https://github.com/vega/altair/pull/3550
* fix: Resolve `Then` copy `TypeError` by dangotbanned in https://github.com/vega/altair/pull/3553
Documentation
* docs: Explain the title `frame` attribute by dsmedia in https://github.com/vega/altair/pull/3537
Other Changes
* ci: bump `ruff>=0.6.0` by dangotbanned in https://github.com/vega/altair/pull/3539
* ci: Remove `m2r` from `mypy.overrides` by dangotbanned in https://github.com/vega/altair/pull/3540
* refactor: Simplify `SchemaBase.copy` by dangotbanned in https://github.com/vega/altair/pull/3543
* fix(typing): Resolve misc type ignores in `schemapi.py` by dangotbanned in https://github.com/vega/altair/pull/3545
* test: Rename test to more specific `chart_error_example__four_errors_hide_fourth` by dangotbanned in https://github.com/vega/altair/pull/3546
* test: Shorten `test_chart_validation_errors` test ids by dangotbanned in https://github.com/vega/altair/pull/3551
* refactor: Replace an indirect `SchemaBase` import by dangotbanned in https://github.com/vega/altair/pull/3556
* test: Fix deprecation warning from `ipywidgets` by dangotbanned in https://github.com/vega/altair/pull/3557


**Full Changelog**: https://github.com/vega/altair/compare/v5.4.0...v5.4.1

5.4.0

<!-- Release notes generated using configuration in .github/release.yml at v5.4.0 -->

What's Changed

Enhancements
* Update Vega-Lite from version 5.17.0 to version 5.20.1; see [Vega-Lite Release Notes](https://github.com/vega/vega-lite/releases). By binste in https://github.com/vega/altair/pull/3479 and https://github.com/vega/altair/pull/3525
* Remove several dependencies to make the package more lightweight:
* feat: **make pandas and NumPy optional dependencies, don't require PyArrow for plotting with Polars/Modin/cuDF** by MarcoGorelli in https://github.com/vega/altair/pull/3452
* Remove `toolz` dependency by dangotbanned in https://github.com/vega/altair/pull/3426
* feat: Improve the syntax for conditions with multiple predicates. See [the documentation of `alt.when` for examples](https://altair-viz.github.io/user_guide/generated/api/altair.when.html) by dangotbanned in https://github.com/vega/altair/pull/3427 and https://github.com/vega/altair/pull/3492
* feat: Reimplement `alt.expr` as a class that is understood by IDEs by dangotbanned in https://github.com/vega/altair/pull/3466
* feat: Support a wider range of iterables, i.e. many places in Altair now accept not only lists but `np.array`, `pd.Series`, `tuples`, etc. by dangotbanned in https://github.com/vega/altair/pull/3501
* feat: Adds 4 new `carbon` themes, provide autocomplete for themes by dangotbanned in https://github.com/vega/altair/pull/3516
* perf: Fix issues with `Chart|LayerChart.encode`, 1.32x speedup to `infer_encoding_types` by dangotbanned in https://github.com/vega/altair/pull/3444

Various typing improvements:
* feat(typing): Adds public `altair.typing` module by dangotbanned in https://github.com/vega/altair/pull/3515
* feat(typing): `deprecated` versioning, IDE highlighting by dangotbanned in https://github.com/vega/altair/pull/3455
* feat: Adds `ChartType` type and type guard `is_chart_type`. Change PurePath to Path type hints by dangotbanned in https://github.com/vega/altair/pull/3420
* feat(typing): adds `Map` alias for `Mapping[str, Any]` by dangotbanned in https://github.com/vega/altair/pull/3458
* feat(typing): Ban `typing.Optional` import using `ruff` by dangotbanned in https://github.com/vega/altair/pull/3460
* feat(typing): Further simplify generated `Literal` aliases by dangotbanned in https://github.com/vega/altair/pull/3469
* feat(typing): Fully annotate `api.py` by dangotbanned in https://github.com/vega/altair/pull/3508

Bug Fixes
* fix(typing): Resolve `mypy==1.11.0` issues in `plugin_registry` by dangotbanned in https://github.com/vega/altair/pull/3487
* fix: solve mypy errors which are due to same object names in core.py and channels.py by binste in https://github.com/vega/altair/pull/3414
* fix: remove remapped `ruff` rule `PLR1701` by dangotbanned in https://github.com/vega/altair/pull/3453
* fix(docs): `utils.use_signature` formatting by dangotbanned in https://github.com/vega/altair/pull/3450
* fix(typing): Ignore `[arg-type]` error in `_deduplicate_enum_errors` by dangotbanned in https://github.com/vega/altair/pull/3475
* fix: Restrict static & runtime top-level imports by dangotbanned in https://github.com/vega/altair/pull/3482
* fix: Avoid `sphinx` error "Code Execution failed:NameError: name 'format_locale' is not defined" by dangotbanned in https://github.com/vega/altair/pull/3503
* fix: replace deprecated `sphinx` default by dangotbanned in https://github.com/vega/altair/pull/3512
* fix(ruff): Bump `ruff`, fix `RUF031` by dangotbanned in https://github.com/vega/altair/pull/3529

Documentation
* docs: Versioning policy by dangotbanned in https://github.com/vega/altair/pull/3488
* docs: Add example of reordering stacked bars by joelostblom in https://github.com/vega/altair/pull/3395
* docs: Add example of how to create polar bar charts by joelostblom in https://github.com/vega/altair/pull/3428
* docs: Add example of cumulative line chart with facet by dsmedia in https://github.com/vega/altair/pull/3440
* docs: Add example with hover path and search box by dsmedia in https://github.com/vega/altair/pull/3459
* docs: Add example for *Bar Chart with Highlighting on Hover and Selection on Click* by dangotbanned in https://github.com/vega/altair/pull/3485
* docs: Link to `Vega Theme Test` in user guide by dangotbanned in https://github.com/vega/altair/pull/3528
* docs: Fix and improve `alt.Optional` doc by dangotbanned in https://github.com/vega/altair/pull/3449
* docs: Fix camel case of fillOpacity channel by timtroendle in https://github.com/vega/altair/pull/3465
* docs: Fix `CONTRIBUTING.md` phrasing by dangotbanned in https://github.com/vega/altair/pull/3477
* docs: Reduce number of items in header to 4 by binste in https://github.com/vega/altair/pull/3401
* docs: Link to project board for roadmap by joelostblom in https://github.com/vega/altair/pull/3404
* docs: Use raw strings with escape sequences by joelostblom in https://github.com/vega/altair/pull/3411
* docs: Update `hatch` guidance by dangotbanned in https://github.com/vega/altair/pull/3461
* docs: Add `empty` as a explicit `condition` kwarg by dangotbanned in https://github.com/vega/altair/pull/3490
* docs: Undoc deprecated functionality by dangotbanned in https://github.com/vega/altair/pull/3509
* docs: Remove reference to `altair_saver` in `save` by dangotbanned in https://github.com/vega/altair/pull/3510
* docs: Update link to Altair Ally by sebp in https://github.com/vega/altair/pull/3517

Maintenance
* chore: Remove CoC link in templates since it's displayed by default by joelostblom in https://github.com/vega/altair/pull/3390
* chore: Update org name from altair-viz to vega by binste in https://github.com/vega/altair/pull/3400
* build: pin upperlimit geopandas by mattijn in https://github.com/vega/altair/pull/3421
* ci: remove again geopandas pin and disable flaky test by binste in https://github.com/vega/altair/pull/3422
* ci: Remove references to archived altair_viewer and altair_saver in ci, docs, and tests. Uninstall anywidget and vl-convert-python during one test run by binste in https://github.com/vega/altair/pull/3419
* ci: prepare for `numpy 2` by dangotbanned in https://github.com/vega/altair/pull/3438
* ci: Add a Dependabot config to auto-update GitHub action versions by kurtmckee in https://github.com/vega/altair/pull/3437
* ci: Update dependabot.yaml to include prefix by mattijn in https://github.com/vega/altair/pull/3442
* ci: Bump the github-actions group with 2 updates by dependabot in https://github.com/vega/altair/pull/3439
* chore: avoid pandas warning for `freq='H'` in test_utils.py by MarcoGorelli in https://github.com/vega/altair/pull/3446
* refactor: Add `ruff` rules, improve type annotations, improve ci performance by dangotbanned in https://github.com/vega/altair/pull/3431
* style: Remove outdated comments about the use of the former _Parameter protocol by binste in https://github.com/vega/altair/pull/3448
* chore: fixup ruff-mypy CI job due to Ruff change by MarcoGorelli in https://github.com/vega/altair/pull/3463
* refactor(typing): Reuse generated `Literal` aliases in `api` by dangotbanned in https://github.com/vega/altair/pull/3464
* ci: remove `toolz` from `[[tool.mypy.overrides]]` by dangotbanned in https://github.com/vega/altair/pull/3474
* refactor: Simplify `SchemaBase` repr by dangotbanned in https://github.com/vega/altair/pull/3472
* refactor: remove dead `_get_channels_mapping` code by dangotbanned in https://github.com/vega/altair/pull/3467
* ci: bump `ruff>=0.5.3` for `PLW1514` fix by dangotbanned in https://github.com/vega/altair/pull/3484
* test: skip `ibis` test on unsupported `python` version by dangotbanned in https://github.com/vega/altair/pull/3486
* refactor(typing): reduce type ignores in `api.py` by dangotbanned in https://github.com/vega/altair/pull/3480
* fix: remove unsupported `sphinx` theme option `'footer_items'` by dangotbanned in https://github.com/vega/altair/pull/3489
* refactor: Rename and move `is_undefined`, `OneOrSeq` by dangotbanned in https://github.com/vega/altair/pull/3491
* refactor(docs, ruff): Add `pydocstyle` rules by dangotbanned in https://github.com/vega/altair/pull/3493
* ci: include optional dependencies for Polars backend in ibis-framework install by MarcoGorelli in https://github.com/vega/altair/pull/3494
* ci: Add `python-version=="3.9"` to github action by dangotbanned in https://github.com/vega/altair/pull/3498
* ci(ruff): Remove stale `docstring-code-format` comment by dangotbanned in https://github.com/vega/altair/pull/3496
* ci: relax `numpy<=2.0.0` constraint by dangotbanned in https://github.com/vega/altair/pull/3504
* refactor: replace archived `m2r` with updated `mistune` by dangotbanned in https://github.com/vega/altair/pull/3506
* build: Add `ipykernel` optional dependency to `dev` group by dangotbanned in https://github.com/vega/altair/pull/3507
* refactor(ruff): Organize imports w/ (`I001`, `TID252`) rules by dangotbanned in https://github.com/vega/altair/pull/3513
* ci: Bump `sphinx`, `vl-convert-python` by dangotbanned in https://github.com/vega/altair/pull/3527
* chore: Remove filterwarnings from tests for cross-version pandas compatibility by MarcoGorelli in https://github.com/vega/altair/pull/3522
* ci(ruff): Enforce the default `C901` complexity by dangotbanned in https://github.com/vega/altair/pull/3531
* refactor: Simplify unreachable compound chart cases by dangotbanned in https://github.com/vega/altair/pull/3520
* feat: Adds `vega-themes.json` using `vl_convert` by dangotbanned in https://github.com/vega/altair/pull/3523

New Contributors
* dangotbanned made their first contribution in https://github.com/vega/altair/pull/3420
* kurtmckee made their first contribution in https://github.com/vega/altair/pull/3437
* dependabot made their first contribution in https://github.com/vega/altair/pull/3439
* dsmedia made their first contribution in https://github.com/vega/altair/pull/3440
* MarcoGorelli made their first contribution in https://github.com/vega/altair/pull/3446
* timtroendle made their first contribution in https://github.com/vega/altair/pull/3465
* sebp made their first contribution in https://github.com/vega/altair/pull/3517

**Full Changelog**: https://github.com/vega/altair/compare/v5.3.0...v5.4.0

5.3.0

<!-- Release notes generated using configuration in .github/release.yml at v5.3.0 -->

The Vega Project is happy to announce the release of version 5.3.0 of the Vega-Altair Python visualization library. This release has been 4 months in the making and includes enhancements, fixes, and documentation improvements from 11 contributors.

What's Changed
- Update Vega-Lite from version 5.16.3 to version 5.17.0; see [Vega-Lite Release Notes](https://github.com/vega/vega-lite/releases)

Enhancements
- Add integration of VegaFusion and JupyterChart to enable scaling many interactive Vega-Altair charts to millions of rows. See [VegaFusion Data Transformer](https://altair-viz.github.io/user_guide/large_datasets.html#vegafusion-data-transformer) for more information. Here is an example of histogram cross filtering with a 1 million row dataset.

https://github.com/altair-viz/altair/assets/15064365/ddca2a1e-6e6b-4d9f-9949-97e0c51b47d9

- Add `"browser"` renderer to support displaying Vega-Altair charts in an external web browser. See [Browser Renderer](https://altair-viz.github.io/user_guide/display_frontends.html#browser-renderer) for more information (3379).

https://github.com/altair-viz/altair/assets/15064365/30d4f2e2-7a30-4c8a-97ae-085d7580c5e4

- Support opening charts in the Vega editor with `chart.open_editor()` (3358)

https://github.com/altair-viz/altair/assets/15064365/9233b290-421d-4fa7-80b2-945423bbc3fc

<!-- This comment ends the list above, so that the rest of the list below goes back to normal linespacing -->

- Add `"jupyter"` renderer which uses JupyterChart for rendering (3283). See [Displaying Altair Charts](https://altair-viz.github.io/user_guide/display_frontends.html#altair-s-renderer-framework) for more information.
- Add `embed_options` argument to JupyterChart to allow customization of Vega Embed options (3304)
- Add offline support for JupyterChart and the new `"jupyter"` renderer. See [JupyterChart - Offline Usage](https://altair-viz.github.io/user_guide/jupyter_chart.html#offline-usage) for more information.
- Add a [new section to documentation](https://altair-viz.github.io/user_guide/display_frontends.html#dashboards) on dashboards which have support for Altair (3299)
- Support restrictive FIPS-compliant environment (3291)
- Simplify type-hints to improve the readability of the function signature and docstring (3307)
- Support installation of all optional dependencies via `python -m pip install altair[all]` and `conda install altair-all -c conda-forge` (3354)
- Add privacy friendly web-analytics for the documentation (3350)
- Additional gallery examples and documentation clarifications (3233, 3266, 3276, 3282, 3298, 3299, 3323, 3334, 3324, 3340, 3350, 3353, 3357, 3362, 3363), including the following:
- [Histogram with Gradient Color](https://altair-viz.github.io/gallery/interactive_column_selection.html)
![image](https://github.com/altair-viz/altair/assets/4560057/669982e9-b41c-4f90-8ff1-94a3dc0057b7)
- [Multi-Line Tooltip (Standard)](https://altair-viz.github.io/gallery/multiline_tooltip_standard.html)
![image](https://github.com/altair-viz/altair/assets/4560057/e054a862-42cd-4946-8c2d-899519517847)
- [Interactive column selection](https://altair-viz.github.io/gallery/interactive_column_selection.html)

https://github.com/altair-viz/altair/assets/4560057/1c2f9b53-b229-4391-bd62-80b1d1c3f5a9

Bug Fixes
- Fix error when `embed_options` are `None` (3376)
- Fix type hints for libraries such as Polars where Altair uses the dataframe interchange protocol (3297)
- Fix anywidget deprecation warning (3364)
- Fix handling of Date32 columns in arrow tables and Polars DataFrames (3377)

Backward-Incompatible Changes
- Changed hash function from `md5` to a truncated `sha256` non-cryptograhic hash (3291)
- Updated `chart.show()` method to invoke the active renderer rather than depend on `altair_saver` (Which was never updated for use with Altair 5) (3379).

New Contributors
* franzhaas made their first contribution in https://github.com/altair-viz/altair/pull/3278
* ccravens made their first contribution in https://github.com/altair-viz/altair/pull/3291
* thomascamminady made their first contribution in https://github.com/altair-viz/altair/pull/3323
* d-trigo made their first contribution in https://github.com/altair-viz/altair/pull/3350
* RobinL made their first contribution in https://github.com/altair-viz/altair/pull/3383

Release notes by pull requests

<details><summary>Click to view all 44 PRs merged in this release</summary>

* perf: Improve performance of `Chart.from_dict` by RobinL in https://github.com/altair-viz/altair/pull/3383
* feature: Add browser renderer to open charts in external browser and update chart.show() to display chart by jonmmease in https://github.com/altair-viz/altair/pull/3379
* fix: Don't error when embed_options are None by jonmmease in https://github.com/altair-viz/altair/pull/3376
* fix: Handle Date32 columns in Arrow tables and Polars DataFrames by jonmmease in https://github.com/altair-viz/altair/pull/3377
* fix: Support falling back to pandas when pyarrow is installed but too old by jonmmease in https://github.com/altair-viz/altair/pull/3387
* docs: Remove release notes and fully capture them in GitHub Releases by binste in https://github.com/altair-viz/altair/pull/3380
* Update save.py to use utf-8 instead of None per default by franzhaas in https://github.com/altair-viz/altair/pull/3278
* Consolidate governance documents in Vega Organization by domoritz in https://github.com/altair-viz/altair/pull/3277
* doc: histogram with gradient color by mattijn in https://github.com/altair-viz/altair/pull/3282
* Update for FIPS Compliance by ccravens in https://github.com/altair-viz/altair/pull/3291
* Docs: Fix link to project governance docs by binste in https://github.com/altair-viz/altair/pull/3298
* Fix type checker errors for libraries such as Polars where Altair uses dataframe interchange protocol by binste in https://github.com/altair-viz/altair/pull/3297
* Integrate VegaFusion into JupyterChart by jonmmease in https://github.com/altair-viz/altair/pull/3281
* Add "jupyter" renderer based on JupyterChart by jonmmease in https://github.com/altair-viz/altair/pull/3283
* Docs: Add section on displaying Altair charts in dashboards by binste in https://github.com/altair-viz/altair/pull/3299
* Validate version of vegafusion-python-embed by jonmmease in https://github.com/altair-viz/altair/pull/3303
* Add embed_options to JupyterChart and pass them through in "jupyter" renderer by jonmmease in https://github.com/altair-viz/altair/pull/3304
* Add offline support to JupyterChart and "jupyter" renderer by jonmmease in https://github.com/altair-viz/altair/pull/3305
* Type hints: Simplify to improve user experiences by binste in https://github.com/altair-viz/altair/pull/3307
* Adding missing interpolation methods to Line example by thomascamminady in https://github.com/altair-viz/altair/pull/3323
* Docs: Link to new section on Altair in Plotly docs by binste in https://github.com/altair-viz/altair/pull/3324
* Docs: Mark completed items in roadmap by binste in https://github.com/altair-viz/altair/pull/3326
* Docs: Mention Marimo in Dashboards section by binste in https://github.com/altair-viz/altair/pull/3334
* Relax type hint for 'indent' in to_json method by binste in https://github.com/altair-viz/altair/pull/3342
* MAINT: Reformat codebase with new style of ruff 0.3.0 by binste in https://github.com/altair-viz/altair/pull/3345
* Docs: Add another version of the 'Multiline Tooltip' exmaple which uses the standard tooltip by binste in https://github.com/altair-viz/altair/pull/3340
* Docs: Add privacy-friendly web analytics with plausible by binste in https://github.com/altair-viz/altair/pull/3346
* Docs: Modifying scale of "multiple interactions" example and adding legend adjustments by d-trigo in https://github.com/altair-viz/altair/pull/3350
* Add example of how to update titles based on a selection parameters by joelostblom in https://github.com/altair-viz/altair/pull/3353
* Add `all` dependency group by jonmmease in https://github.com/altair-viz/altair/pull/3354
* Add timeseries filtering example to illustrate subsetting of columns from selector values by joelostblom in https://github.com/altair-viz/altair/pull/3357
* Fix anywidget deprecation warning by jonmmease in https://github.com/altair-viz/altair/pull/3364
* Clarifications to the interactive docs by joelostblom in https://github.com/altair-viz/altair/pull/3362
* Open charts in the default browser with `open_editor` method by joelostblom in https://github.com/altair-viz/altair/pull/3358
* Change "mouse" to "pointer" everywhere by joelostblom in https://github.com/altair-viz/altair/pull/3363
* doc: update numpy-tooltip-images.rst by mattijn in https://github.com/altair-viz/altair/pull/3233
* Change a couple of more additional occurences of pointer over by joelostblom in https://github.com/altair-viz/altair/pull/3368
* [Doc] Fix Chart and MarkDef language by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3266
* Add remaining changelog entries for 5.3 by joelostblom in https://github.com/altair-viz/altair/pull/3369
* Upgrade to Vega-Lite 5.17.0 by binste in https://github.com/altair-viz/altair/pull/3367
* Add a few 5.3 changelog entries by jonmmease in https://github.com/altair-viz/altair/pull/3372
* Add note about conda "all" installation and how to install without optional dependencies by joelostblom in https://github.com/altair-viz/altair/pull/3373
* Update README badges to reflect updated tool chain by mattijn in https://github.com/altair-viz/altair/pull/3374
* chore: Add templates for PRs and automated release notes by joelostblom in https://github.com/altair-viz/altair/pull/3381

</details>

**Full Changelog**: https://github.com/altair-viz/altair/compare/v5.2.0...v5.3.0

5.2.0

What's Changed
* Update Vega-Lite from version 5.15.1 to version 5.16.3; see [Vega-Lite Release Notes](https://github.com/vega/vega-lite/releases).

Enhancements

1. Support offline HTML export using vl-convert (3251)

You now can use:

chart.save('chart.html', inline=True)

To create an HTML file with inline JavaScript dependencies. This enhancements takes advantage of HTML bundling support in `vl-convert` to replace the dependency on `altair_viewer`. Vega-Altair 5.2.0 expects `vl-convert-python` [version 1.1.0](https://pypi.org/project/vl-convert-python) or higher for this enhancement.
***

2. Support saving charts as PDF files using the vl-convert export engine (3244)

You now can use:

chart.save('chart.pdf')

To create an PDF representation of your chart. This enhancements takes advantage of PDF support in `vl-convert` to replace the dependency on `altair_saver`. Vega-Altair 5.2.0 expects `vl-convert-python` [version 1.1.0](https://pypi.org/project/vl-convert-python) or higher for this enhancement.

***
3. Support converting charts to sharable Vega editor URLs with chart.to_url() (3252)

You now can use:

chart.to_url()

To generate a Vega editor URL that opens the chart's specification in the online Vega editor. This enhancements takes advantage of lz-string URL-compatible compression in `vl-convert`. Vega-Altair 5.2.0 expects `vl-convert-python` [version 1.1.0](https://pypi.org/project/vl-convert-python) or higher for this enhancement.

Example:
python
import altair as alt
from vega_datasets import data

chart = alt.Chart(data.cars.url).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
color='Origin:N'
)

print(chart.to_url())


> [https://vega.github.io/editor/#/url/vega-lite/N4Igxg9gdgZglgcxALlANzgUwO4tJKAFzigFcJSBnAdTgBNCALFAZgAY2AacaYsiygAlMiRoVYcAvpO50AhoTl4QpAE4AbFCDGEADpWQB6Q2DpQAdACtKdTOrhpV5qJkKGougLaG0mBHIBaeUVKV0oAATQARnMAJgBOczZDYLkTOVVKK0poEBkQTwyAa2VCAE9dTC1dCBJxfMwoSDoSJFQedQhVZXg7Oi0AeVVEEhBucsqtKAhPEjlNfIAPHqx1fuQQQS7QmuxMbvGKqo2AR1I5IjhFYl887jKVvq0AWTh1TEoAfUrVT4BxeadKBjEATY4gM4XYjXBxVaTcAAklDAjEwhS0On0Rh8fjk5gQV0YpAARuY4BBDMjUYUcf4AvZCJgfABWcxRABs5hY2VykiAA](https://vega.github.io/editor/#/url/vega-lite/N4Igxg9gdgZglgcxALlANzgUwO4tJKAFzigFcJSBnAdTgBNCALFAZgAY2AacaYsiygAlMiRoVYcAvpO50AhoTl4QpAE4AbFCDGEADpWQB6Q2DpQAdACtKdTOrhpV5qJkKGougLaG0mBHIBaeUVKV0oAATQARnMAJgBOczZDYLkTOVVKK0poEBkQTwyAa2VCAE9dTC1dCBJxfMwoSDoSJFQedQhVZXg7Oi0AeVVEEhBucsqtKAhPEjlNfIAPHqx1fuQQQS7QmuxMbvGKqo2AR1I5IjhFYl887jKVvq0AWTh1TEoAfUrVT4BxeadKBjEATY4gM4XYjXBxVaTcAAklDAjEwhS0On0Rh8fjk5gQV0YpAARuY4BBDMjUYUcf4AvZCJgfABWcxRABs5hY2VykiAA)

***
4. Pass `format_locale` and `time_format_locale` through to vl-convert to support locales in static image export (3274)

The preferred format of numbers, dates, and currencies varies by language and locale. Vega-Altair takes advantage of [D3’s localization support](https://d3-wiki.readthedocs.io/zh-cn/master/Localization/) to make it easy to configure the locale for your chart using the global `alt.renderers.set_embed_options` function. Vega-Altair 5.2.0 expects `vl-convert-python` [version 1.1.0](https://pypi.org/project/vl-convert-python) or higher for this enhancement.

See https://altair-viz.github.io/user_guide/customization.html#localization for more info (including the note with a caveat!).
***
5. Vega-Altair is now a typed package, with type annotations for all public functions and classes and some of the internal code

See https://github.com/altair-viz/altair/issues/2951 for a full summary how we have implemented these. Type hints can help IDEs to provide a better development experience as well as static type checkers to catch potential errors before they appear at runtime.

Maintenance
- Vega-Altair now uses ruff for maintaining code quality & consistency (3243)
- Vega-Altair is tested against Python 3.12 (3235)

Bug Fixes
- None

Backward-Incompatible Changes
- None

New Contributors
* ChiaLingWeng made their first contribution in https://github.com/altair-viz/altair/pull/3218


Release Notes by Pull Request

<details><summary>Click to view all 31 PRs merged in this release</summary>

* Perform minor consistency cleanup by joelostblom in https://github.com/altair-viz/altair/pull/3215
* [Doc] Add integers to four digit year format example by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3218
* Maint: Do not pass literal json to read_json in test by binste in https://github.com/altair-viz/altair/pull/3221
* Do not display search keyboard shortcut on home page by joelostblom in https://github.com/altair-viz/altair/pull/3220
* [Doc] Add Label Position Based on Condition Example by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3226
* [Doc] Update UserGuide: Add Rotate Axis, Sort Legend Example, Citing Section by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3217
* [Doc] Add Show Image Marks With Selection/Show Local Images Examples by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3219
* [Doc] Add Reverse Scale and Update Example for Consistency by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3228
* Correct the method-based syntax for a few more gallery examples by joelostblom in https://github.com/altair-viz/altair/pull/3005
* doc: update pandas to smallcase p by mattijn in https://github.com/altair-viz/altair/pull/3232
* Type hint api.py by binste in https://github.com/altair-viz/altair/pull/3143
* maint: change to ruff for formatting by mattijn in https://github.com/altair-viz/altair/pull/3243
* maint: GitHub action include `python-version` 3.12 by mattijn in https://github.com/altair-viz/altair/pull/3235
* Support saving to PDF with VlConvert 1.0 by jonmmease in https://github.com/altair-viz/altair/pull/3244
* Support converting a Chart to a Vega editor URL by jonmmease in https://github.com/altair-viz/altair/pull/3252
* Type hint utils/save.py and utils/mimebundle.py by binste in https://github.com/altair-viz/altair/pull/3248
* docs: add range bar chart by mattijn in https://github.com/altair-viz/altair/pull/3250
* doc: barchart highlighting values beyond a single threshold by mattijn in https://github.com/altair-viz/altair/pull/3249
* Update image export error message with PDF format by jonmmease in https://github.com/altair-viz/altair/pull/3255
* Use vl-convert for offline html export by jonmmease in https://github.com/altair-viz/altair/pull/3251
* doc: add example interactive aggregation by mattijn in https://github.com/altair-viz/altair/pull/3260
* [Doc] Add Arrow Vector Example by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3236
* [Doc] Add scatter plot with shaded area example by ChiaLingWeng in https://github.com/altair-viz/altair/pull/3256
* Make facet error more informative by joelostblom in https://github.com/altair-viz/altair/pull/3264
* Type hints: Infer types from vegalite schema for autogenerated code by binste in https://github.com/altair-viz/altair/pull/3208
* Fix broken JupyterWidget chart by pinning Vega by jonmmease in https://github.com/altair-viz/altair/pull/3269
* Type hints: Finish type hints and mark package as typed by binste in https://github.com/altair-viz/altair/pull/3272
* Update to Vega-Lite 5.16.3 by jonmmease in https://github.com/altair-viz/altair/pull/3273
* Pass locale info through to vl-convert, default to display embed options when not set by jonmmease in https://github.com/altair-viz/altair/pull/3274
* doc: add example, interval selection on a map by mattijn in https://github.com/altair-viz/altair/pull/3275
* doc: maintain colors by mattijn in https://github.com/altair-viz/altair/pull/3276

</details>

**Full Changelog**: https://github.com/altair-viz/altair/compare/v5.1.2...v5.2.0

5.1.2

What's changed

- Update Vega-Lite from version 5.14.1 to version 5.15.1; see [Vega-Lite Release Notes](https://github.com/vega/vega-lite/releases/tag/v5.15.1).
- Use Facet/Trellis/Repeat consistently in the documentation by NickCrews in 3180
- Add tutorial on numpy tooltip images by joelostblom 3202

https://github.com/altair-viz/altair/assets/4560057/3a9ae5d2-104a-4143-bef6-0d8a551c4393



Bug Fixes

- Remove usage of deprecated Pandas parameter ``convert_dtypes`` by binste in 3191
- Fix encoding type inference for boolean columns when pyarrow is installed by jonmmease in 3210

**Full Changelog**: https://github.com/altair-viz/altair/compare/v5.1.1...v5.1.2

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.