Public
Edited
Oct 26, 2023
8 forks
17 stars
Also listed in…
Gallery
Insert cell
Insert cell
Insert cell
Insert cell
circles = {
const step = 10;
const circle = d3.geoCircle().center(d => d).radius(step / 4).precision(10);
const coordinates = [];
for (let y = -80; y <= 80; y += step) {
for (let x = -180; x < 180; x += step) {
coordinates.push(circle([x, y]).coordinates);
}
}
return {type: "MultiPolygon", coordinates};
}
Insert cell
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
d3 = require("d3-geo@3", "d3-geo-projection@4")
Insert cell
import {projectionInput} from "@d3/projection-comparison"
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