viewof s3 = Plot.plot({
title: `Per-client latency over time (dots edition)`,
subtitle: `Hover to highlight the other quantiles for the same instance.`,
inset: 10,
marks: [
Plot.frame({ fill: "#f3f3f3" }),
Plot.gridX({ stroke: "#fff", strokeOpacity: 1 }),
Plot.gridY({ stroke: "#fff", strokeOpacity: 1 }),
Plot.dot(data, {
x: "second",
y: "latencyMs",
fy: "quantile",
r: 1,
fill: "#ccc"
}),
Plot.dot(data, {
x: "second",
y: "latencyMs",
fy: "quantile",
r: 1,
fill: "#f00",
className: "linked",
sort: { fy: { reverse: true } },
channels: { instance: "instance" },
tip: {
render: (index, scales, values, dimensions, context, next) => {
const instance = values.instance;
const key = instance[index[0]];
d3.select(context.ownerSVGElement)
.selectAll(".linked circle")
.attr("fill-opacity", (i) => +(instance[i] === key));
return next(index, scales, values, dimensions, context);
}
}