Plot.plot({
width: 1152,
height: 1000,
insetLeft: 10,
insetRight: 60,
r: {range: [0, 100]},
style: "overflow: visible;",
marks: [
Plot.frame({anchor: "bottom"}),
Plot.dot(
fails,
Plot.dodgeY({
anchor: "bottom",
padding: 2,
x: "Date",
r: "Assets",
title: (d) => `${d["Bank Name"]}\n${(d["Assets"] / 1000).toFixed(1)}B`,
fill: "#902",
stroke: "#000",
strokeWidth: 1.2
})
),
Plot.text(
fails,
Plot.dodgeY({
anchor: "bottom",
padding: 2,
filter: (d) => d.Assets > 2000,
x: "Date",
lineWidth: 5,
r: "Assets",
text: (d) => d.Assets > 12900
? `${d["Bank Name"]}\n${(d["Assets"] / 1000).toFixed(0)}B`
: `${(d["Assets"] / 1000).toFixed(1)}`,
pointerEvents: "none",
fill: "#fff",
})
)
]
})