Published
Edited
Feb 23, 2021
Insert cell
Insert cell
Insert cell
Insert cell
data = aq.fromCSV(await FileAttachment("elec@5.csv").text())
.derive({"time_in_week_": d => d.time_in_week / (3600 * 24)})
Insert cell
data.view()
Insert cell
{
let line = vl.markLine({opacity: 0.8, size: 0.9})
.data(data)
.encode(
vl.x().fieldQ("time_in_week_").scale({domain: [0, 7]}),
vl.y().fieldQ("Demand"),
vl.detail().fieldN("week"),
vl.color().fieldN("year"),
vl.tooltip().fieldN("week")
)
.width(600);
return line.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