Published
Edited
Nov 25, 2021
Insert cell
# Learning Vega lite - failed copy-paste ?!
Insert cell
Insert cell
vegalite ({
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://vega.github.io/vega-datasets/data/movies.json"
},
"repeat": {"layer": ["Worldwide Gross", "US Gross"]},
"spec": {
"mark": "bar",
"encoding": {
"x": {
"field": "Major Genre",
"type": "nominal"
},
"y": {
"aggregate": "sum",
"field": {"repeat": "layer"},
"type": "quantitative",
"title": "Total Gross"
},
"color": {"datum": {"repeat": "layer"}, "title": "Gross"},
"xOffset": {"datum": {"repeat": "layer"}}
}
},
"config": {
"mark": {"invalid": null}
}
} )
Insert cell
vegalite = require("@observablehq/vega-lite")

Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more