Plot.plot({
marginLeft: 50,
insetTop: 40,
insetRight: 15,
x: { type: "time" },
y: { label: "Miles remaining", labelAnchor: "center" },
color: {legend: true, label: "Minutes lost per minute", type: "diverging-symlog", scheme: "RdYlGn", reverse: true},
width,
marks: [
Plot.arrow(data.slice(1), { x1: "at", y1: "miles", x2: "arrival", y2: () => 0, stroke: "slope" }),
Plot.arrow(data.slice(0, 1), { x1: "at", y1: "miles", x2: "arrival", y2: () => 0, stroke: "black" }),
Plot.line(data, {x: "at", y: "miles", stroke: "#ccc"}),
Plot.dot([data.at(-1)], {x: "at", y: () => 0, fill: "black"}),
Plot.text(data, {x: "at", y: "miles", text: "startNote", lineWidth: "8", dy: -20}),
Plot.text(data, {x: "arrival", y: () => 0, text: "endNote", lineWidth: "8", dy: -20, dx: 5})
]
})