Published
Edited
Aug 27, 2020
Fork of Orthographic
5 forks
7 stars
Insert cell
Insert cell
Insert cell
map = html`<svg width=${width} height=${height} viewBox="0 0 ${width} ${height}" style="display:block;">
<path d="${path(graticule)}" stroke="#ccc" fill="none"></path>
<path d="${path(land)}"></path>
<path d="${path(sphere)}" stroke="#000" fill="none"></path>
</svg>`
Insert cell
path = d3.geoPath(projection)
Insert cell
projection = d3.geoOrthographic()
.rotate(rotate)
.fitWidth(width, sphere)
.precision(0.1)
Insert cell
height = {
const [[, y0], [, y1]] = d3.geoPath(projection).bounds(sphere);
return y1 - y0;
}
Insert cell
sphere = ({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
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3-geo@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