Skip to main content
100%

Zoomable Globe with Cities Template

✓ Published4🌍 Public
CCurran Kelleher
Last edited Jan 17, 2026
Created on Jan 16, 2026

This interactive globe visualizes major world cities using an orthographic projection, with labels that dynamically appear as users drag to rotate and scroll to zoom. Canvas handles the geographic rendering of countries, graticule, and sphere gradient via `d3.geoOrthographic` and `d3.geoPath`, while an SVG overlay draws city labels using collision detection powered by `rbush`. Population data from a CSV file is filtered and scaled with `d3.scaleSqrt`, with interactive controls implemented through D3’s `drag` and `zoom` behaviors.

AI-generated description

Features

  • 🌍 Interactive 3D globe with orthographic projection
  • 🏙️ Dynamic city labels with collision detection
  • 🔄 Smooth drag-to-rotate and zoom interactions
  • 🌙 Dark mode aesthetic with elegant color scheme
  • ⚡ Canvas rendering for geo with SVG labels for superior text quality

Architecture

  • Canvas Layer: Renders geographic features (sphere, graticule, countries)
  • SVG Overlay: Renders city labels with proper text antialiasing and paint-order

The separation allows optimal performance for each rendering type while maintaining clean visual output.

Interaction

  • Drag to rotate the globe
  • Scroll to zoom in/out
  • City labels appear dynamically based on population and viewport visibility
MIT Licensed

Similar vizzes