VegaLite.jl v2.1 released

By: David Anthoff

Re-posted from: https://www.queryverse.org//2020/04/06/vegalite-v2.1/

I just released VegaLite.jl v2.1. While this release just tracks what is happening upstream in the Vega-Lite project, there are some really nice feature additions.

For all the details you can read through the release notes of Vega-Lite:

I’ll use the rest of this post to highlight a few key new features.

Arc marks

Vega-Lite now supports a new arc mark that makes it easy to create pie, donut and radial charts:

arc mark

For more information, you can read the original Vega-Lite documentation and you can look at a number of Julia examples.

Datum in encoding

The new support for datum in encodings makes it easy to add for example a rule at a given point to a figure.

An example that adds a horizontal rule to a figure is this:

using VegaLite, VegaDatasets

dataset("stocks") |>
@vlplot() +
@vlplot(:line, "date:t", :price, color=:symbol) +
@vlplot(mark={:rule, strokeDash=[2,2], size=2}, y={datum=300})

figure

Note how the y channel here is given a datum, that is a value from the underlying price domain.

For temporal values this has especially nice syntax:

using VegaLite, VegaDatasets

dataset("stocks") |>
@vlplot() +
@vlplot(:line, "date:t", :price, color=:symbol) +
@vlplot(mark={:rule, strokeDash=[2,2], size=2}, x={datum={year=2006}})

figure

Note how we can set a value for a specific year here.

Angle channel for point and text marks

A new angle channel makes it easy to create for example the following wind vector map:

figure

You can find the Julia code for this example in the documentation.

Conclusion

This release was literally zero work on the Julia side of things, all the thanks for these new features should go to the awesome Vega-Lite team that keeps adding new functionality at an amazing speed!