Public
Edited
Jul 12, 2023
Insert cell
Insert cell
Plot.plot({width: 1000, height: 760,
projection: ({width, height}) => d3.geoMercator()
.scale(2400)
.center([-74, 4.5])
.translate([width / 2, height / 2]),
marks: [
Plot.geo( dptos, {fill: (d) => datvb.get(d.properties.DPTO_CCDGO),
title: (d) => `RM: ${datvb.get(d.properties.DPTO_CCDGO)}`, stroke: 'white' } ) ,
Plot.text( dptos.features,
Plot.centroid({
text: (d) => d.properties.DPTO_CNMBR, textAnchor: "middle", fill: "black" }),
{ fontSize: "6px" } )],
color: {scheme: "Spectral", type: "linear", legend: true, domain: [.95,1.15] ,
label: "Relación de masculinidad al nacer" }})
Insert cell
import {mapData} from "@john-guerra/topojson-colombia"
Insert cell
mapData
Insert cell
mapData.bbox = [
-81.73562055599996,
-4.229406465999944,
-66.84721542699998,
13.394727762000059
]
Insert cell
mpios = topojson.feature(mapData, mapData.objects.MGN_ANM_MPIOS)
Insert cell
dptos = topojson.feature(mapData, mapData.objects.MGN_ANM_DPTOS)
Insert cell
datvb = new Map(datc.map(({DPTO_CCDGO, datos}) => [DPTO_CCDGO, datos]))
Insert cell
datc=data1

Insert cell
data@2.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

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