Public
Edited
May 20, 2023
Fork of Blog Post
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cobertura
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
indice
Insert cell
Insert cell
departamentos = FileAttachment("depto.json").json()
Insert cell
depart = ({
...departamentos,
})
Insert cell
lacobertura = new Map(
cobertura.map((c) => [
c.depISO,
indice == "total_viviendas_sin_servicio"
? c.total_viviendas_sin_servicio
: c.indice_de_cobertura
])
)
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
{
let codes = departamentos.features
.sort((a, b) => {
const nameA = a.properties.shapeISO; // ignore upper and lowercase
const nameB = b.properties.shapeISO; // ignore upper and lowercase
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}

// names must be equal
return 0;
})
.map((c) => c.properties.shapeISO);
codes.pop(14);
return codes;
}
Insert cell
Select a data source…
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
departamentos
Insert cell
cobertura.map((a, b) => (a.depISO = codes[b]))
Insert cell
atlantico = lacobertura.get("CO-ATL")
Insert cell
departamentos.features.map((d) => lacobertura.get(d.properties.shapeISO))
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"

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