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;
}
}