globe = {
const context = this ? this.getContext("2d") : DOM.context2d(w, w);
const canvas = context.canvas;
canvas.angle = canvas.angle || 0;
canvas.style.display = "block";
canvas.style.margin = "auto";
const color = d3.color(quakeColor);
color.opacity = quakeOpacity;
const projection = d3.geoOrthographic().scale(r).translate([w / 2, w / 2]);
const path = d3.geoPath(projection, context);
function inspection(name, value){
context.font = "50px";
context.fillStyle = "red";
context.fillText(name + " : " + value, w/2, w/2);
}
while (true) {
projection.rotate([canvas.angle += spinSpeed, 0]);
context.clearRect(0, 0, w, w);
context.lineWidth = 1.5;
context.fillStyle = oceanColor;
context.beginPath(), context.arc(w / 2, w / 2, r, 0, 2 * Math.PI), context.fill(), context.stroke();
context.lineWidth = lineWidth;
context.fillStyle = landColor;
context.beginPath(), path(earth), context.fill(), context.stroke();
context.fillStyle = color;
let circles = dots == "projected" ? quakeCircles : quakes.features;
if (dots == "unprojected") path.pointRadius(magnitudeRadius);
circles.forEach(d => {context.beginPath(), path(d); context.fill()});
path.pointRadius(null);
inspection("canvas.angle", canvas.angle);
yield canvas;
}
}