Published
Edited
Aug 3, 2019
1 fork
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
visibleYextent = 2 * altitude * Math.tan(0.5 * fieldOfView * Math.PI / 180)
Insert cell
Insert cell
Insert cell
scale = earthRadius * numPixelsY / visibleYextent;
Insert cell
Insert cell
snyderP = 1 + altitude / earthRadius;
Insert cell
projection = d3.geoSatellite()
.translate([width / 2, numPixelsY / 2])
.scale(scale)
.rotate([-longitude, -latitude, 0])
.distance(snyderP)
.clipAngle(Math.acos(1 / snyderP) * 180 / Math.PI)
.precision(0.1);
Insert cell
Insert cell
numPixelsY = width * 0.6;
Insert cell
earthRadius = 6371; // Spherical approximation: average radius in km
Insert cell
horizon = ({type: "Sphere"})
Insert cell
graticuleMinor = d3.geoGraticule().step([5,5])()
Insert cell
graticuleMajor = d3.geoGraticule().step([15,15])()
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
world = fetch("https://cdn.jsdelivr.net/npm/world-atlas@1/world/50m.json").then(response => response.json())
Insert cell
topojson = require("topojson-client@3")
Insert cell
import {number} from "@jashkenas/inputs"
Insert cell
d3 = require("d3-geo@1", "d3-geo-projection@2")
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