Public
Edited
Dec 4
Insert cell
Insert cell
import {v1} from "@vega/vega-lite-api-v5"
Insert cell
import {printTable} from "@uwdata/data-utilities"
Insert cell
stats = FileAttachment("Metro Area Edu Stats - Sheet1.csv").csv()
Insert cell
printTable(stats)
Insert cell
vl.markLine({tooltip:true})
.data(stats)
.transform(
vl.fold(['female','male']).as(['gender','count'])
)
.encode(
vl.x().fieldO('year'),
vl.y().fieldQ('count'),
vl.column().fieldO("location").title("People in Metro Areas"),
vl.color().fieldN('education_level').title("Education Attainment"),
)
.width(300)
.height(300)
.render()

Insert cell
{
return vl.markLine({tooltip:true})
.encode(
vl.x().fieldO('year'),
vl.y().fieldQ('count'),
vl.color().fieldN('education_level').title("Education Attainment")
)
.width(300)
.height(300)
.transform(vl.fold(['female','male']).as(['gender','count']))
.facet({column: vl.field('count')})
.data(stats)
.render();
}
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