testLegend = Plot.plot({
width: width/2.4,
marginLeft: 120,
marginRight: 50,
height: 120,
y: {
grid: false,
tick: false,
},
marks: [
Plot.text(distances, {x: 'distance', dx: 20, y: 'mode', text: 'distance', }),
Plot.link(distances,
{x1: 0, x2: "distance", y: "mode", strokeWidth: 2, stroke: d => legendScale(d['mode']), markerEnd: "arrow"}, ),
Plot.dot(distances, {x: 0, y: 'mode', fill: d => legendScale(d['mode']), r:5, stroke: 'white', }),
]
})