Skip to content

Version 5.2.0

Compare
Choose a tag to compare
@mattijn mattijn released this 28 Nov 06:23
· 188 commits to main since this release

What's Changed

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 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 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 or higher for this enhancement.

    Example:

    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


  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 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 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 #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

Release Notes by Pull Request

Click to view all 31 PRs merged in this release

Full Changelog: v5.1.2...v5.2.0