Public
Edited
Apr 2, 2024
1 fork
Insert cell
Insert cell
Plot.plot({
caption:
"Disability-Adjusted Life Years are computed by multiplying the estimated number of people in the country with depression by an estimate for how bad depression is. Data from the Global Burden of Disease Study (2019).",
projection: "equal-earth",
width,
color: {
legend: true,
label: "Disability-Adjusted Life Years (Estimated)",
scheme: "magma",
unknown: "white"
},
marks: [
Plot.geo(gbdGeo, {
fill: (d) => d.properties["DALYs"],
stroke: "currentColor",
strokeWidth: 0.5
}),
Plot.sphere(),
Plot.tip(
gbdGeo.features,
Plot.pointer(
Plot.centroid({
channels: {
Country: (d) => d.properties["Name"],
"Depression Burden": (d) => d.properties["DALYs"] ?? "No data"
}
})
)
)
]
})
Insert cell
import { depressionDALYsPerCountry2019 as gbd } from "@huw/gbd"
Insert cell
import { countries110m as countries } from "@visionscarto/geo"
Insert cell
import { fixCode, codeToName } from "@huw/iso-3166-1"
Insert cell
gbdGeo = ({
...countries,
features: countries.features.map((d1) => ({
...d1,
properties: {
...gbd.find((d2) => d2["Code"] === fixCode(d1.properties.a3)),
Name: codeToName[fixCode(d1.properties.a3)]
}
}))
})
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more