Plot.plot({
inset: 60,
aspectRatio: 1,
axis: null,
marks: [
Plot.dot(nodes, {r: 40}),
Plot.arrow(edges, {
x1: ([[x1]]) => x1,
y1: ([[, y1]]) => y1,
x2: ([, [x2]]) => x2,
y2: ([, [, y2]]) => y2,
bend: true,
strokeWidth: ([,, value]) => value,
strokeLinejoin: "miter",
headLength: 24,
inset: 48
}),
Plot.text(nodes, {text: ["A", "B", "C"], dy: 12}),
Plot.text(edges, {
x: ([[x1, y1], [x2, y2]]) => (x1 + x2) / 2 + (y1 - y2) * 0.15,
y: ([[x1, y1], [x2, y2]]) => (y1 + y2) / 2 - (x1 - x2) * 0.15,
text: ([,, value]) => value
})
]
})