Published
Edited
Feb 12, 2021
Insert cell
Insert cell
Insert cell
Insert cell
data = aq.fromCSV(await FileAttachment("language_summary@5.csv").text())
Insert cell
data_ = data.derive({
low: d => d.avg_correct - 2 * d.sd_correct / Math.sqrt(d.n),
high: d => d.avg_correct + 2 * d.sd_correct / Math.sqrt(d.n)
})
Insert cell
data_.view()
Insert cell
{
let ribbon = vl.markArea({opacity: 0.2})
.encode(
vl.y().fieldQ("low").scale({zero: false}),
vl.y2().fieldQ("high")
)
let line = vl.markLine()
.encode(vl.y().fieldQ("avg_correct").title("Test Score"))
return vl.layer(ribbon, line)
.encode(
vl.x().fieldQ("Eng_start").title("Age when started learning English").axis({tickCount: 4}),
vl.color().fieldN("age_group").scale({scheme: "set2"}).title("Current Age").legend({orient: "bottom", symbolOpacity: 1})
)
.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