Viewing a saved revision (read-only)
b2983eeca018406aaf02b1e94e7191e9
Spinning Globe with capitals
A spinning globe displays capital cities as proportional points, with land, water, graticules, the equator, and the prime meridian rendered in gradient colors that shift with the rotating orthographic projection. Using d3-geo’s `geoPath` and `geoOrthographic`, the animation advances longitude each frame via `requestAnimationFrame`, while city radius scales with square-rooted population data from a reduced world cities CSV. Overlaid graticule lines and country borders are clipped to the globe’s visible hemisphere, producing a stylized, night-side gradient effect.
AI-generated descriptionA spinning globe with capital cities.
Initially, I just wanted to change the rotation, add graticule and the equator, then I realized that those lines are clipping as expected, so tried to add the capital cities too in the same manner.
See also:
- d3-geo: projection.rotate
- Wikipedia: Aircraft principal axes
- MDN: Window.requestAnimationFrame()
- d3-geo, path - Documents the "Sphere" type used for the outline
- orthographic projection with clipping