Plot.plot({
width: 960,
height: 600,
projection: "albers",
color: {
scheme: "blues"
},
marks: [
Plot.dot(withPreviousCoords, {
x: "Long",
y: "Lat",
stroke: (d, i) => (i === range ? "red" : "grey"),
r: 3
}),
Plot.link(withPreviousCoords, {
x2: "Long",
y2: "Lat",
x1: "prevLong",
y1: "prevLat",
stroke: (d, i) => (i === range ? "red" : "silver"),
strokeWidth: (d, i) => (i === range ? 3 : 1.5),
markerEnd: "arrow"
}),
Plot.geo(statemesh, { strokeOpacity: 0.5 }),
Plot.geo(nation, { strokeOpacity: 0.7 })
]
})