Public
Edited
May 18
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
Insert cell
census = FileAttachment("census2000-1.csv").csv()
Insert cell
printTable(census.slice(0,5))
Insert cell
Insert cell
vl.markBar()
.data(census)
.encode(
vl.x().fieldN("Year"),
vl.y().fieldQ("People")
)
.width(400)
.height(300)
.render()

Insert cell
Insert cell
Insert cell
vl.markLine()
.data(census)
.encode(
vl.x().fieldN("Age").title("Age Group"),
vl.y().fieldQ("People").title("Population"),
vl.color().fieldN("Year").title("Year")
)
.width(400)
.height(300)
.render()

Insert cell
Insert cell
Insert cell
vl.markBar()
.data(census)
.encode(
vl.x().fieldN("Sex").title("Sex"),
vl.y().fieldQ("People").title("Population")
)
.width(400)
.height(300)
.render()

Insert cell
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