chart = Plot.plot({
y: { grid: true, domain: [0, 6] },
marginRight: 50,
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(data, {
x: "TIME",
y: "Value",
z: "LOCATION",
stroke: "#ddd",
filter: (d) => !countriesToShow.includes(d["LOCATION"])
}),
Plot.lineY(data, {
x: "TIME",
y: "Value",
z: "LOCATION",
stroke: "LOCATION",
filter: (d) => countriesToShow.includes(d["LOCATION"])
}),
Plot.text(
data.filter((d) => d["TIME"] === 2021),
{
x: "TIME",
dx: 15,
y: "Value",
z: "LOCATION",
text: "LOCATION",
filter: (d) => countriesToShow.includes(d["LOCATION"])
}
)
]
})