Public
Edited
Nov 7
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
centros_de_salud_nivel_1_badata_wgs84 = FileAttachment("centros_de_salud_nivel_1_BADATA_WGS84.json").json()
Insert cell
caba
Insert cell
Insert cell
cesacs = topojson.feature(
centros_de_salud_nivel_1_badata_wgs84,
centros_de_salud_nivel_1_badata_wgs84.objects
.centros_de_salud_nivel_1_BADATA_WGS84
)
Insert cell
//topojson = require("https://unpkg.com/topojson@3")
Insert cell
Insert cell
Insert cell
Radios
Insert cell
Censo2022-CABA - CABA- Radios (2).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Indicadores de personas. Radios, 2010 - Ciudad Autónoma de Buenos Aires.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
datos2010Map = new Map(
datos2010.map((d) => [
d["Nombre de departamentos/comuna"].replace(" ", "") + d.radio.slice(5),
d["Población total"]
])
)
Insert cell
Indicadores de personas. Radios, 2022 - Ciudad Autónoma de Buenos Aires.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
datos2022
Insert cell
cambioPoblacion = datos2022.map((d) => {
var datos2010 = datos2010Map.get(
d["Nombre de departamentos/comuna"].replace(" ", "") + d.radio.slice(5)
);
return {
radio: d.radio,
pob2010: datos2010,
comuna: d["Nombre de departamentos/comuna"],
pob2022: d["Población total"],
diferencia: d["Población total"] - datos2010,
diferenciaPorc: (d["Población total"] - datos2010) / datos2010
};
})
Insert cell
variacionMap = new Map(cambioPoblacion.map((d) => [d.radio, d.diferenciaPorc]))
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
title: "Variación población 2010-2022",
// subtitle:
// "Los ",
caption: "Censo 2022, CABA",
projection: {
type: "mercator",
domain: caba
},
color: {
scheme: "RdYlGn",
type: "diverging",
label: null,
legend: true,
tickFormat: ".0%",
domain: [0, 1]
//type: "log"
//reverse: true
},
width: width,
marks: [
Plot.geo(cabaTopojson, {
fill: (d) => variacionMap.get(d.properties.link),
stroke: "black",
strokeWidth: 0.1
}),

Plot.geo(caba)
]
})
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