Plot.plot({
x: {type: "point", axis: "top", label: null},
y: {axis: "left", inset: 10},
color: {
domain: [false, true],
range: ["#ccc", "red"]
},
marks: [
Plot.line(banks, {x: "Year",
y: "Market_Values_Bn",
z: "Name",
strokeWidth: 1,
sort: highlight,
stroke: highlight
}
),
Plot.text(banks, Plot.selectFirst({x: "Year", y: "Market_Values_Bn", z: "Name", text: d => `${d.Market_Values_Bn} ${d.Name} `, textAnchor: "end", dx: 100})),
Plot.text(banks, Plot.selectLast({x: "Year", y: "Market_Values_Bn", z: "Name", text: d => `${d.Name} ${d.Market_Values_Bn} `, textAnchor: "start", dx: -100})),
]
})