Public
Edited
Jan 25, 2024
1 fork
1 star
Insert cell
Insert cell
Plot.plot({
width,
height: width / 2,
projection: {
type: geoOrtelius,
rotate: [-150, 0],
domain: { type: "Sphere" },
inset: 2
},
marks: [
Plot.graticule(),
Plot.geo(land, { fill: "currentColor", fillOpacity: 0.2 }),
Plot.sphere()
]
})
Insert cell
geoOrtelius = ({ width = 960, height = 500, rotate = [0, 0] } = {}) => {
const pi_2 = Math.PI / 2;
const pi2_4 = pi_2 ** 2;
return d3
.geoProjection((x, y) => {
const s = Math.sign(x);
x = Math.abs(x);
const f = Math.max(1e-12, Math.min(x, pi_2));
const F = (f + pi2_4 / f) / 2;
return [s * (x + F * (Math.sqrt(1 - (y / F) ** 2) - 1)), y];
})
.precision(0.1)
.scale(width / 2 / Math.PI)
.translate([width / 2, height / 2])
.rotate(rotate);
}
Insert cell
Insert cell
Plot.plot({
width: 644,
height: 324,
projection: geoOrtelius,
marks: [Plot.graticule(), Plot.sphere()]
})
Insert cell
import { land } from "@visionscarto/geo"
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