Insert cell
Insert cell
data = aq
.from(gbd)
.join(aq.from(wbi), "Code")
.join(aq.from(wbc), "Code")
.derive(
{
Name: aq.escape((d) => codeToName[d["Code"]]),
Code: (d) => d["Code"],
"Income Group": (d) => d["Income group"],
"Depressed Adults": (d) => d["Population"],
"Internet Usage Proportion": (d) => d["Proportion"]
},
{ drop: true }
)
.derive({
"Depressed Adult Internet Users": (d) =>
d["Internet Usage Proportion"] &&
d["Depressed Adults"] * d["Internet Usage Proportion"]
})
.filter((d) => !!d["Depressed Adult Internet Users"])
.filter(
(d) =>
d["Income Group"] === "Low income" ||
d["Income Group"] === "Lower middle income"
)
.objects()
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
indianDepressedAdults = data.find((d) => d["Name"] === "India")[
"Depressed Adults"
]
Insert cell
llmicDepressedAdults = d3.sum(data, (d) => d["Depressed Adults"])
Insert cell
indiaDepressedAdultsProportion = indianDepressedAdults / llmicDepressedAdults
Insert cell
Insert cell
indianDepressedInternetConnectedAdults = data.find(
(d) => d["Name"] === "India"
)["Depressed Adult Internet Users"]
Insert cell
llmicDepressedInternetConnectedAdults = d3.sum(data, d => d["Depressed Adult Internet Users"])
Insert cell
indiaDepressedInternetConnectedAdultsProportion = indianDepressedInternetConnectedAdults /
llmicDepressedInternetConnectedAdults
Insert cell
Insert cell
import { data as wbc } from "@huw/world-bank-categories"
Insert cell
import { dataLatest as wbi } from "@huw/world-bank-internet"
Insert cell
import { depressiveDisordersOver20PopulationPerCountry2021 as gbd } from "@huw/gbd"
Insert cell
import { fixCode, codeToName } from "@huw/iso-3166-1"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more