function slopeChart(data) {
return Plot.plot({
width: 500,
height: 1000,
x: {type: "point", axis: "top"},
y: {axis: null, inset: 10},
color: {
type: "ordinal",
domain: continents,
range: colors
},
marks: [
Plot.line(data, {x: "year", y: 'value', z: "name", strokeWidth: 1.5, stroke: "continent"}),
Plot.text(data, Plot.selectFirst({x: "year", y: 'value', z: "name", text: d => getText(d, 'value', data, label), textAnchor: "end", dx: -3, fill: "continent", fontSize: 6})),
Plot.text(data, Plot.selectLast({x: "year", y: 'value', z: "name", text: d => getText(d, 'value', data, label), textAnchor: "start", dx: 3, fill: "continent", fontSize: 6})),
]
})
}