Plot.plot({
title: "CO2 emissions in Europe per country",
subtitle: "Data from 2022",
width: 500,
projection: { type: "conic-conformal", domain: eu_data_map },
color: {
scheme: "YlOrRd",
label: selected_plot.legend,
legend: true
},
marks: [
Plot.geo(eu_countries, { fill: (d) => d.properties[selected_plot.variable], opacity: 1 }),
Plot.geo(other_eu, { fill: "grey" , stroke: "white", opacity: 0.15 }),
Plot.geo(not_esp_ita, {stroke: "black",strokeWidth: 0.5 }),
Plot.geo(esp_ita, {stroke: "black",strokeWidth: 2 }),
Plot.dot(eu_countries, Plot.centroid({ fill: "white", stroke: "black" })),
Plot.tip(eu_countries, Plot.pointer(
Plot.centroid({
stroke: "white",
strokeWidth: 0.125,
tip: true,
channels: {
"Country": d => d.properties.country,
" - CO2": d => d.properties.co2,
" - CO2 per capita": d => d.properties.co2_per_capita
}
})
))
]
});