Skip to content

Releases

Version 6.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 06:37
78c66bf

What's Changed

See below for details on what is new in this release. A special compatibility note is that this release drops support for Python 3.10 (which is reaching end of life in Oct).

Enhancements

Bug Fixes

  • fix: raise TypeError for invalid property setter arguments by @suzunn in #4068
    • Previously, these would be silently discarded but now an error would be raised instead, e.g. the second argument in alt.X("field:Q").scale(["a", "b"], ["#1FC3AA", "#8624F5"])
  • fix: Expression objects not working in alt.value() by @genrichez in #4083
    • You can now write alt.value(alt.expr.scale("x", alt.datum.c1) in addition to alt.value(alt.expr("scale('x', datum.c1)")).
  • fix: report missing anywidget for JupyterChart by @dk3yyyy in #4089

Documentation

Maintenance

New Contributors

Full Changelog: v6.2.2...v6.3.0

Version 6.2.2

Choose a tag to compare

@github-actions github-actions released this 23 Jun 12:46
a976571

What's Changed

Bug Fixes

Documentation

Maintenance

New Contributors

Full Changelog: v6.2.1...v6.2.2

Version 6.2.1

Choose a tag to compare

@github-actions github-actions released this 05 Jun 16:22
5fc9d9e

What's Changed

Bug Fixes

Maintenance

Full Changelog: v6.2.0...v6.2.1

Version 6.2.0

Choose a tag to compare

@github-actions github-actions released this 05 Jun 15:09
64cbdde

This is the first release in an effort to have smaller, more frequent releases going forward. By making the release process more convenient, we aim to more quickly push out fixes and features that already landed on the main branch to a released version of Altair.

What's Changed

Enhancements

Bug Fixes

  • fix: Propagate params to outer level after add_params in concat charts by @jtilly in #4019

Maintenance

New Contributors

Full Changelog: v6.1.0...v6.2.0

Version 6.1.0

Choose a tag to compare

@joelostblom joelostblom released this 21 Apr 14:51

What's Changed

There are many exciting improvements in this release! Read on for details and a big thanks to everyone who contributed πŸŽ‰

Enhancements

  • feat: Update to Vega-Lite 6.4.1 by @joelostblom in #4005. See the Vega-Lite Release Notes for details; a few highlights:
    • Newlines are now supported in tooltips.
    • The default stack order of marks like bars and areas is now aligned with the color domain.
    • Interactive charts automatically change the cursor to pointer to indicate they can be interacted with.
  • feat: auto hoist facet encodings in layer by @thomascamminady in #3965
    • This allows layering of simple faceted charts that define the same facet variables, instead of requiring that layering happens before faceting.
  • feat: Accept ZoneInfo(key='UTC') by @JackKelly in #3944
  • feat: add pandas 3 compatibility and fix CI (drop Python 3.9, pin polars <1.38) by @mattijn in #3950
  • feat: add ensure_ascii option to to_json() with default False by @RamiNoodle733 in #3952

Bug Fixes

Documentation

Other Changes

New Contributors

Full Changelog: v6.0.0...v6.1.0

Version 6.0.0

Choose a tag to compare

@mattijn mattijn released this 12 Nov 11:01
8693285

Release v6.0.0

The Vega-Altair team is pleased to announce the release of version 6.0.0. Firstly, we are grateful for the many returning contributors (@franzhaas, @dangotbanned, @dsmedia, @joelostblom, @tempdata73, @mattijn, @jonmmease, @eitanlees, @kurtmckee, @MarcoGorelli), and a special shoutout to all the new contributors (@JasonnnW3000, @edmundmiller, @jannisko, @stanmart, @star1327p, @baldwint, @daizutabi, @azjps, @joaopalmeiro, @bobot). You are all awesome!

In short what is included with the version 6 release of Altair.

  • we now compile against Vega-Lite version 6 (to be specific, version 6.1.0) and provide support for Python 3.14.
  • we have a new datasets module, altair.datasets, lazily access to datasets from https://github.com/vega/vega-datasets.
  • we are now thread-safe, altair specifications should be stable after re-running.
  • we improved docs and included new examples, eg. this faceted choropleth of habitat species across geographical counties https://altair-viz.github.io/gallery/maps_faceted_species.html.
  • we improved the typing experiences.
  • we migrated to uv as part of the infrastructure modernization and now have automated weekly builds.

We test all changes thoroughly, but nevertheless, if you encounter any issue or like to start a discussion. Please feel free!

Full details are available in the complete changelog below.

Breaking

Enhancements

Bug Fixes

Documentation

Other Changes

Read more

Version 5.5.0

Choose a tag to compare

@jonmmease jonmmease released this 24 Nov 00:12
b2ff8ce

Release 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 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.

Example of registering a custom theme

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")`

Example of instant feedback while you define a theme config through Pylance in VSCode

Enhancements

Olli Renderer

This release integrates the 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

Example of olli renderer:

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

Expressions and Selections

Several improvements were made to Altair's expression and selection APIs:

Example of combining predicates within .transform_filter

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

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

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

Multiple predicates and constraints in Chart.transform_filter

Example of using keyword-argument constraints to simplify filter compositions:

import altair as alt
from vega_datasets import data

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

Bug Fixes

Documentation

Several new examples were added to the documentation

Example of using alt.when().then().otherwise()

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

Example of using luminance in an expression to dynamically colorize text

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
Read more

Version 5.4.1

Choose a tag to compare

@joelostblom joelostblom released this 27 Aug 04:41

What's Changed

Enhancements

Bug Fixes

Documentation

Other Changes

Full Changelog: v5.4.0...v5.4.1

Version 5.4.0

Choose a tag to compare

@binste binste released this 11 Aug 08:22

What's Changed

Enhancements

Various typing improvements:

Bug Fixes

Documentation

Maintenance

New Contributors

Read more

Version 5.3.0

Choose a tag to compare

@binste binste released this 30 Mar 15:36

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

Enhancements

  • Add integration of VegaFusion and JupyterChart to enable scaling many interactive Vega-Altair charts to millions of rows. See VegaFusion Data Transformer for more information. Here is an example of histogram cross filtering with a 1 million row dataset.

    vegafusion_widget.mov
  • Add "browser" renderer to support displaying Vega-Altair charts in an external web browser. See Browser Renderer for more information (#3379).

    browser_renderer.mov
  • Support opening charts in the Vega editor with chart.open_editor() (#3358)

    open_editor.mov

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

Release notes by pull requests

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