Wiki ▸ Documentation
Vega is a visualization grammar: a declarative format for describing and creating data visualizations. Other, existing grammars (Wilkinson's Grammar of Graphics, Wickham's ggplot2 and Tableau's VizQL) focus on rapid generation of charts to support analysis. However, in service of rapid specification these systems make a number of decisions on behalf of the user, and also impose limits on the type of visualizations one can create. Vega is intended to be lower-level, enabling fine-gained control of the visualization design. Vega's model of visualization design is intimately influenced by the Protovis and D3 frameworks.
A Vega specification is simply a JSON object that describes a visualization. A specification describes the data sets used, scale transforms and encoding algorithms, axes, and visual marks (rectangles, lines, shapes, etc) whose properties may depend on the data. In effect, Vega specifications can serve as a "file format" for custom visualization designs. These specifications may be read and interpreted by a runtime system to dynamically create visualizations, or a specification may be cross-compiled to provide a reusable visualization component, in the form of editable code for a specific visualization framework (such as D3).
While intended to be a general (platform-agnostic) specification, Vega has been primary designed for creating web-based visualizations using HTML5 technologies such as Canvas and SVG (Scalable Vector Graphics). This focus has inevitably sculpted the specification language to the web domain.
A Vega specification is simply a JSON object that describes a visualization design. We will refer to the top-level object as the Visualization specification. A Visualization 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 that visualize these scales as ticks and labels, and graphical Marks (such as rectangles, circles, arcs, etc) that visualize the data.
To start learning Vega, we recommend first working through the introductory Bar Chart Tutorial.
Next, you can explore the online examples in the Vega Editor and read the more detailed documentation below.
Documentation for each major component of a Vega specification can be found on these wiki pages:
Last edited by Kanit Wongsuphasawat,