Published
Edited
Aug 27, 2020
1 star
Insert cell
Insert cell
projection = d3.geoModifiedStereographicLee()
Insert cell
map
Insert cell
outline = ({
type: "Polygon",
coordinates: [
[
d3.range(w - 1).map(p => [p, 0]),
d3.range(h - 1).map(q => [w, q]),
d3.range(w, 0, -1).map(p => [p, h]),
d3.range(h - 1, 0, -1).map(q => [0, q])
]
.flat()
.map(projection.scale(w * (225 / 900)).translate([w / 2, h / 2]).invert)
]
})
Insert cell
w = width
Insert cell
h = (width * (2 / 3)) | 0
Insert cell
import {map} with {projection, outline} from "@d3/world-map"
Insert cell
d3 = require("d3@6", "d3-geo-projection@3")
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