Public
Edited
Dec 20, 2022
7 forks
6 stars
Insert cell
Insert cell
chart = {
const width = 960;
const height = 960;
const speed = 0.004;
const sphere = {type: "Sphere"};
const graticule = d3.geoGraticule10();
const context = DOM.context2d(width, height);
const projection = d3.geoOrthographic().fitExtent([[4, 4], [width - 4, height - 4]], sphere);
const path = d3.geoPath(projection, context);
while (true) {
projection.rotate([speed * performance.now(), -15]);
context.clearRect(0, 0, width, height);
context.save();
context.beginPath();
projection.precision(0);
path(ocean);
context.globalAlpha = 0.5;
context.fillStyle = "steelblue";
context.fill();
context.beginPath();
projection.precision(0.5);
path(graticule);
context.globalAlpha = 0.5;
context.strokeStyle = "#fff";
context.stroke();
context.beginPath();
path(sphere);
context.lineWidth = 2;
context.strokeStyle = "#000";
context.stroke();
context.restore();
yield context.canvas;
}
}
Insert cell
Insert cell
ocean = topojson.feature(topology, topology.objects.ocean)
Insert cell
topology = FileAttachment("ocean-110m.json").json()
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