Published
Edited
Aug 27, 2020
Fork of Orthographic
4 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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more