Public
Edited
Aug 22, 2023
Fork of Orthographic
9 forks
36 stars
Insert cell
Insert cell
map = {
const width = 928;
const height = width;

const context = DOM.context2d(width, height);
const projection = d3.geoStereographic()
.rotate([95, 45])
.translate([width / 2, height / 2])
.scale(width / 10.1)
.center([30, -5])
.clipAngle(166);
const path = d3.geoPath(projection, context);

const land = topojson.feature(world, world.objects.land);

context.lineJoin = "round";
context.lineCap = "round";
context.fillStyle = "#fff";
context.fillRect(0, 0, width, height);

context.beginPath();
path({type: "Sphere"});
path(land);
context.lineWidth = 0.5;
context.stroke();
context.clip("evenodd");

context.save();
context.beginPath();
path(land);
context.filter = "blur(12px)";
context.fillStyle = "#aaa";
context.fill("evenodd");
context.restore();
context.beginPath();
path(d3.geoGraticule10());
context.globalAlpha = 0.2;
context.strokeStyle = "#000";
context.stroke();

return context.canvas;
}
Insert cell
world = FileAttachment("land-50m.json").json()
Insert cell
d3 = require("d3-geo@1")
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