Published
Edited
Aug 27, 2020
Fork of Orthographic
5 forks
10 stars
Insert cell
Insert cell
projection = d3.geoSatellite()
.translate([width / 2, height / 2])
.scale(5500)
.center([-2, -1])
.rotate([76, -34, 32])
.tilt(25)
.distance(1.1)
.clipAngle(Math.acos(1 / 1.1) * 180 / Math.PI)
.precision(0.1)
Insert cell
map = {
const context = DOM.context2d(width, height);
const path = d3.geoPath(projection, context);
context.beginPath(), path(land), context.fill();
context.beginPath(), path(graticule), context.strokeStyle = "#aaa", context.globalAlpha = 0.4, context.stroke();
context.beginPath(), path(sphere), context.strokeStyle = "#000", context.stroke();
return context.canvas;
}
Insert cell
height = width * 1.6
Insert cell
sphere = ({type: "Sphere"})
Insert cell
graticule = d3.geoGraticule().step([1, 1])()
Insert cell
us = FileAttachment("us-land.json").json()
Insert cell
land = topojson.feature(us, us.objects.land)
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3-geo@2", "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