Published
Edited
Feb 27, 2021
Insert cell
Insert cell
Insert cell
Insert cell
data = aq.fromCSV(await FileAttachment("fires@5.csv").text())
Insert cell
data.view()
Insert cell
Insert cell
{
let points = vl.markCircle()
.encode(
vl.x().fieldQ("day_of_year"),
vl.y().fieldN("Counties").sort({op: "median", field: "Latitude", order: "descending"}),
vl.size().fieldQ("AcresBurned").scale({range: [25, 2000]})
)
.width(600)
.height(600)
return points.data(data).render()
}
Insert cell
Insert cell
{
let selectYear = vl.selectSingle("select").fields("year")
.bind(vl.slider().min(2013).max(2019).step(1))
let points = vl.markCircle()
.select(selectYear)
.encode(
vl.x().fieldQ("day_of_year"),
vl.y().fieldN("Counties").sort({op: "median", field: "Latitude", order: "descending"}),
vl.color().if(selectYear, vl.value("#ff7a00")).value("#d3d3d3"),
vl.opacity().if(selectYear, vl.value(0.9)).value(0.2),
vl.size().fieldQ("AcresBurned").scale({range: [25, 2000]}),
vl.tooltip().fieldN("Name")
)
.width(600)
.height(600)
return points.data(data).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