{
const data = papers.map((d, i) => ({
...d,
y: d.Year + ((i % 20) - 10) / 40,
cited: +d["AminerCitationCount"] || 0
}));
const index = d3.index(data, (d) => d.DOI);
const links = data.flatMap(
(d) =>
d.InternalReferences?.split(";").map((ref) => ({
...d,
x1: d.cited,
x2: index.get(ref)?.cited,
y2: index.get(ref)?.y
})) || []
);
return Plot.plot({
width,
height: 1200,
marks: [
Plot.arrow(links, {
x1: "x1",
x2: "x2",
y1: "y",
y2: "y2",
bend: true,
strokeWidth: 1 / 16
}),
Plot.dot(data, {
x: "cited",
y: "y",
title: d => `${d.Title}\n${(d["AuthorNames"]||"").split(";").join(", ")}`,
href: "Link",
target: "_blank",
fill:
colorBy === "Conference"
? "Conference"
: colorBy === "Paper type"
? "PaperType"
: "currentColor"
})
],
x: { label: "Citations →", labelAnchor: "left", type: "pow", exponent: 0.3, transform: d => d + 1, tickRotate: 30 },
y: { tickFormat: "", grid: true },
color: {
legend: true,
tickFormat: d => (colorBy === "Conference" ? d : paperType(d)),
...(colorBy === "Conference" && { scheme: "plasma" })
}
});
}