Introducing the Grammar of Interactive Graphics with VegaLite
Vega-Lite is a JavaScript library that extended the Grammar of Graphics to a Grammar of Interactive Graphics. It uses Vega as a backend, and you need to write the plot specifications in JSON. Its grammar refers to mark as geometry, channel as aesthetic, and encoding as mapping. The grammar provides statistics such as density, inside transformations, and interactivity mainly through selection.
You can use Vega-Lite from Julia thanks to the VegaLite
package. Its @vlplot
macro allows you to write the specification in Julia. In the @vlplot
macro, the first positional argument indicates the mark to use, and the keyword arguments indicate channels and encodings. Let’s look at some examples of the syntax in action:
- Create a new Pluto notebook and execute the following code in the first cell:
begin using Pkg Pkg.activate(temp=true) Pkg.add(...