Vega-Lite provides a higher-level grammar for visual analysis, akin to ggplot or Tableau, that generates complete Vega specifications.
Vega-Lite specifications consist of simple mappings of variables in a data set to visual encoding channels such as position (x
,y
), size
, color
and shape
. These mappings are then translated into detailed visualization specifications in the form of Vega specification language. Vega-Lite produces default values for visualization components (e.g., scales, axes, and legends) in the output Vega specification using a rule-based approach, but users can explicit specify these properties to override default values.
Try using Vega-Lite in the online Vega Editor.
The language and API are described in the documentation. The complete schema for specifications as JSON schema is at vega-lite-schema.json.
Feel free to ask questions about Vega-Lite in the Vega Discussion Group / Mailing List.
Contributions are also welcomed. Please refer to CONTRIBUTING.md for contribution and development guidelines.
This is a similar chart as one of the Vega examples in https://github.com/vega/vega/wiki/Tutorial. See how much simpler it is.
{
"data": {
"values": [
{"a":"A", "b":28}, {"a":"B", "b":55}, {"a":"C", "b":43},
{"a":"D", "b":91}, {"a":"E", "b":81}, {"a":"F", "b":53},
{"a":"G", "b":19}, {"a":"H", "b":87}, {"a":"I", "b":52}
]
},
"mark": "bar",
"encoding": {
"x": {"type": "ordinal", "field": "a"},
"y": {"type": "quantitative", "field": "b"}
}
}
We have more example visualizations in our gallery, the documentation, and the online editor.