We are excited to announce the official version 2 release of Vega-Lite, a high-level language for rapidly creating interactive visualizations.

Vega-Lite enables concise descriptions of visualizations as a set of encodings that map data fields to the properties of graphical marks. Vega-Lite uses a portable JSON format that compiles to full specifications in the larger Vega language. Vega-Lite includes support for data transformations such as aggregation, binning, filtering, and sorting, as well as visual transformations such as stacking and faceting into small multiples.

In addition to an expressive range of static visualizations, Vega-Lite 2.0 adds support for flexible combinations of charts and interactions such as panning, zooming, interactive filtering, and linked selection. Version 2 introduces three major additions: view composition, interaction, and Vega 3 support.

View Composition

A powerful aspect of modular approaches to visualization is the ability to create sophisticated graphics by composing simple ones. Vega-Lite has four operators to compose charts: layer, facet, concat and repeat. With layer, you can stack charts on top of each other and Vega-Lite automatically determines how to align the axes and share scales. Facet subdivides the data into groups and creates a chart for each partition. Concat combines arbitrary charts into dashboard layouts. Finally, repeat is a data-driven way to concatenate charts.

Most importantly, these operators can be combined! Authors can create rich multi-view graphics within one declarative specification. The example below compares weather data in New York and Seattle, layering data for individual years and averages within a repeated template for different measurements.