Public
Edited
Jan 26, 2023
Insert cell
Insert cell
data = await require("vega-datasets")
Insert cell
weatherdata = (await data["seattle-weather.csv"]()).filter(
({ date }) => date.getFullYear() > 2014 && date.getMonth() > 8
)
Insert cell
temp_max_width = {
let min = Number.MAX_VALUE;
for (let i = 0; i < weatherdata.length - 1; i++) {
}
return min;
}
Insert cell
vl
.markBar({
width: {
expr: `scale('x')`
}
})
.data(weatherdata)
.encode(vl.x().fieldT("date"), vl.y().fieldQ("precipitation"))
.width(width)
.height(500)
.toString()
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