Plot.plot({
caption:
"Data on prevalence is estimated from real data sources and statistical models for the region. Data from the WHO Global Health Observatory (2015).",
projection: "equal-earth",
width,
color: {
legend: true,
percent: true,
domain: [0, 6.5],
label: "Percentage of Population with Depression",
scheme: "magma",
unknown: "white"
},
marks: [
Plot.geo(gbdGeo, {
fill: (d) => d.properties["Proportion"],
stroke: "currentColor",
strokeWidth: 0.5
}),
Plot.tip(
gbdGeo.features,
Plot.pointer(
Plot.centroid({
channels: {
Country: (d) => d.properties["Name"],
Prevalence: (d) => d.properties["Proportion"]
},
format: {
Country: true,
Prevalence: (d) => `${Math.round(d * 100 * 100) / 100}%`
}
})
)
)
]
})