lineChart = Plot.plot({
marginBottom: marginBottom,
marginRight: marginRight,
width: W,
height: h,
x: {
domain: __domain.map((d) => d[0]),
tickRotate: +45,
tickSize: 10,
label: `← closer to probe ID ${probes[0]} ASN further away from probe ID ${probes[0]} →`,
tickFormat: (origin) => generateLabel(origin)
},
y: {
label: "Latency [ms]",
grid: true,
zero: true
},
marks: probes
.map((p, i) =>
Plot.line(__domain, {
x: ([origin, probesData]) => origin,
y: ([origin, probesData]) => probesData[i].min_rtt,
curve: "step",
fill: "none",
stroke: "rgb(19,32,72)",
strokeWidth: 3
})
)
.concat(
Plot.tooltip(__domain, {
x: (d) => d[0],
y: (d) => d3.max(d[1].map((d) => d.min_rtt)),
content: ([origin, probesData]) => tooltipContent(origin, probesData),
direction: "up"
})
)
})