Public
Edited
Feb 3, 2023
Insert cell
Insert cell
spec = ({
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
data: {
values: [
{ a: "A", b: 28 },
{ a: "A", b: 55 }
]
},
mark: {
opacity: 0.5,
type: "bar"
},
encoding: {
x: { field: "a", type: "nominal" },
y: { field: "b", type: "quantitative" }
}
})
Insert cell
vl4 = require("vega-lite@4")
Insert cell
vl5 = require("vega-lite@5")
Insert cell
embed = require("vega-embed")
Insert cell
embed(vl4.compile(spec).spec)
Insert cell
embed(vl5.compile(spec).spec)
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