Public
Edited
Mar 1, 2023
Insert cell
Insert cell
UVA_bball_allyears.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
scores = FileAttachment("UVA_bball_allyears.csv").csv()
Insert cell
Insert cell
chart ={
let mySVG = d3.select(svg);
let midline = mySVG.attr("height")/2;
let startX = 5;
let spacing = 3;

let sparklines = mySVG.selectAll("line")
.data(scores)
.join("line")
.attr("x1", (d,i) => startX + i * spacing)
.attr("x2", (d,i) => startX + i * spacing)
.attr("y1", midline)
.attr("y2", d => midline - Number(d.UVA_score) + +d.Opponent_score)
.attr("class", d => {
if (d.Location == "Charlottesville, Va.") {
return "home";
} else {
return "away";
}
})
}
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