Published
Edited
Jan 26, 2021
Insert cell
Insert cell
tExt = d3.extent(selectedEvents.map(e => e.timestamp))
Insert cell
tMin = tExt[0]
Insert cell
tMax = tExt[1]
Insert cell
dt = tMax - tMin
Insert cell
getCs = t => getContestantSummarys(selectedEvents.filter(e => e.timestamp <= t))
Insert cell
chart.update(t)
Insert cell
tickDuration = 1500
Insert cell
viewof t = Player(
d3.range(tMin + 0.1 * dt, tMax - 0.3 * dt, (tMax - tMin) / 400),
{
width: 450,
delay: tickDuration,
// time: true,
loop: true
}
)
Insert cell
Insert cell
color = d3.scaleOrdinal()
.domain(checkpoints)
.range(d3.schemeSpectral[10])
.unknown("#ccc")
Insert cell
Insert cell
Insert cell
xAxis = (g, x) =>
g
.attr("transform", `translate(0,${margin.top})`)
.call(d3.axisTop(x))
.call(g => (g.selection ? g.selection() : g).select(".domain").remove())
Insert cell
yAxis = (g, y) => g
.attr("transform", `translate(${margin.left},0)`)
.call(d3.axisLeft(y).tickSizeOuter(0))
Insert cell
height = margin.top + 20 * 10
Insert cell
margin = ({top: 30, right: 20, bottom: 0, left: 30})
Insert cell
d3 = require("d3@5")
Insert cell
Insert cell
Insert cell
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