function bumpMarks(data, {r = 3, highlightStroke = 0, curve = "bump-x", ...options}) {
const stack = Plot.stackY2(options);
let marks = [
Plot.line(data, {...stack, stroke: stack.z, curve, fill: null}),
Plot.text(data, Plot.selectFirst({...stack, text: stack.z, dx: -(5 + r), textAnchor: "end", fill: "currentColor"})),
Plot.text(data, Plot.selectLast({...stack, text: stack.z, dx: (5 + r), textAnchor: "start", fill: "currentColor"})),
];
if(r) {
const stackSelection = Plot.map(
{x: series => series.map(date => date.getUTCMonth() === 0 ? date : null)},
stack
);
marks.push(Plot.dot(data, {...stackSelection, fill: stack.z, r}))
marks.push(Plot.text(data, {fill: stack.z, dy: -6, ...stackSelection, text: stack.y}))
}
if(highlightStroke) {
marks.push(keepZ(language, Plot.line(data, {...stack,
stroke: stack.z,
strokeWidth: highlightStroke,
curve,
fill: null
})))
}
return marks
}