Public
Edited
Sep 28, 2023
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
coordinates = FileAttachment("paises_2016_geom_10.csv").csv({ typed: true })
Insert cell
function obtenerCoord() {
let countriesToPaint = Object.keys(listarPaises(search));
let coordinates2 = new Array();
for (var j = 0; j < countriesToPaint.length; j++) {
var pais2 = countriesToPaint[j];

for (var i = 0; i < coordinates.length; i++) {
var pais3 = coordinates[i].etiqueta;

if (pais2 === pais3) {
var nuevaLinea = coordinates[i];
nuevaLinea.radio = listarPaises(search)[pais2];
coordinates2.push(nuevaLinea);
}
}
}
return coordinates2;
}
Insert cell
path = d3.geoPath(projection)
Insert cell
projection = d3.geoNaturalEarth1()
Insert cell
height = {
const [[x0, y0], [x1, y1]] = d3
.geoPath(projection.fitWidth(width, outline))
.bounds(outline);
const dy = Math.ceil(y1 - y0),
l = Math.min(Math.ceil(x1 - x0), dy);
projection.scale((projection.scale() * (l - 1)) / l).precision(0.2);
return dy;
}
Insert cell
outline = ({ type: "Sphere" })
Insert cell
graticule = d3.geoGraticule10()
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
world = FileAttachment("land-50m.json").json()
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3@6")
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