The Vega visualization grammar provides basic building blocks for a wide variety of visualization designs. This page provides documentation of Vega JSON specifications and JavaScript API.

To start learning Vega, we recommend first working through the introductory Let’s Make A Bar Chart tutorial and exploring the example gallery, then digging into the documentation. These pages document Vega version 3.0 and later; if you are familiar with Vega 2.x, you might begin with the Vega 2 porting guide.

Specification Reference

A Vega specification is a JSON object that describes an interactive visualization design. A specification consists of basic properties (such as the width and height of the view) and definitions for the data to visualize, scales that map data values to visual values, axes and legends that visualize these scales, cartographic projections for drawing maps, graphical marks such as rectangles, lines, and symbols to visually represent data, and signals to process user input and modify the visualization in response.

Specification Overview of a full Vega specification, including sizing and metadata.
Config Configure defaults for visual encoding choices.
Data Define, load, and parse data to visualize.
Transforms Apply data transforms (filter, sort, aggregate, layout) prior to visualization.
Triggers Modify data sets or mark properties in response to signal values.
Projections Cartographic projections to map (longitude, latitude) data.
Scales Map data values (numbers, strings) to visual properties (coordinates, colors, sizes).
Schemes Color schemes that can be used as scale ranges.
Axes Visualize scale mappings for spatial encodings using coordinate axes.
Legends Visualize scale mappings for color, shape and size encodings.
Title Specify a chart title for a visualization.
Marks Visually encode data with graphical marks such as rectangles, lines, and symbols.
Signals Dynamic variables that can drive interactive updates.
Event Streams Define input event streams to specify interactions.
Expressions Express custom calculations over data and signals.
Layout Perform grid layout for a collection of group marks.
Types Documentation of recurring parameter types.

Vega API Reference

Vega also provides a JavaScript runtime API, responsible for parsing JSON specifications to produce interactive views backed by a reactive dataflow graph of data processing operators. For more on deploying Vega, see the usage instructions.

Parser Parse Vega JSON specifications to dataflow descriptions.
View Create interactive views from dataflow descriptions.
Locale Use number and date formats for a specific locale.
Extensibility Extend Vega with new projections, scales, color schemes, or data transforms.
Statistics Statistical methods used by Vega.
Time Utility methods for date-time values.
Util General JavaScript utilities.
Debugging A guide to debugging Vega visualizations at runtime.