Public
Edited
Nov 14, 2024
Importers
Insert cell
Insert cell
Insert cell
Plot.plot({
caption: "Data from the World Bank (2024).",
projection: "equal-earth",
width,
color: {
legend: true,
label: "Region",
unknown: "white"
},
marks: [
Plot.geo(geo, {
fill: (d) => d.properties["Region"],
stroke: "currentColor",
strokeWidth: 0.5
}),
Plot.sphere(),
Plot.tip(
geo.features,
Plot.pointer(
Plot.centroid({
channels: {
Country: (d) => d.properties["Name"],
Region: (d) => d.properties["Region"]
},
format: {
Country: true,
Proportion: d3.format(".2%")
}
})
)
)
]
})
Insert cell
workbook = FileAttachment("CLASS.xlsx").xlsx()
Insert cell
dataRaw = workbook.sheet(0, { headers: true, range: "A1:E219" })
Insert cell
dataRaw
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
import { countries110m as countries } from "@visionscarto/geo"
Insert cell
import { fixCode, codeToName } from "@huw/iso-3166-1"
Insert cell
geo = ({
...countries,
features: countries.features.map((d1) => ({
...d1,
properties: {
...data.find((d2) => d2["Code"] === fixCode(d1.properties.a3)),
Name: codeToName[fixCode(d1.properties.a3)]
}
}))
})
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