durationOverTime = data => {
const xy = ({x: "started_at", y: "minutes"});
return Plot.plot({
marginBottom: 55,
width,
color,
x: {
tickFormat: ((i, f) => d => i(d) < d ? null : f(d))(d3.timeDay, dateFormat),
ticks: d3.timeHour.every(6)
},
marks: [
Plot.ruleY([0]),
Plot.areaY(data, Plot.binX({y1: q1, y2: q3}, {...xy, fill: "#eee", curve: "linear"})),
Plot.dot(data, {...xy, stroke: "conclusion", r: 3, strokeOpacity: 0.5}),
getTooltip(data, xy)
]
})
}