Plot.plot({
width,
height: 1200,
marginLeft: 110,
padding: 0.05,
color: {
type: "sqrt",
interpolate: d3.interpolatePuRd,
legend: true,
label: "Tonnes of CO2 equivalent",
tickFormat: (d) => formatLabel(d),
},
x: {
axis: "top",
label: "",
},
y: {
label: "",
},
marks: [
Plot.cell(
top_100 ,
{
x: "year",
y: "country",
z: "value",
fill: "value",
title: (d) => `${d.country} (${d.year}) - ${formatLabel(d.value)} tonnes`,
sort: { x: "y", reverse: true },
}
),
]
})