# cambecc/earth architecture

> Architecture diagram of the GitHub repository cambecc/earth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cambecc/earth
- Repository: https://github.com/cambecc/earth

## Overview

Earth is a browser-based global weather visualization. A visitor opens the map, whose configuration selects a globe view and data layer; the application builds/interpolates a field and renders animated particles and optional colored overlays. The README documents hash-persisted settings and event-driven updates, plus weather, ocean-current, projection, and map-data capabilities. The sampled sources show rendering and overlay coordination, but not the complete initialization or networking code, so uncertain internal links are omitted.

Main entry points: [`public/libs/earth/1.0.0/earth.js`](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js) (Earth application), [`public/libs/earth/1.0.0/products.js`](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/products.js) (Weather products), [`public/index.html`](https://github.com/cambecc/earth/blob/master/public/index.html) (Map page), [`public/templates/il8n.json`](https://github.com/cambecc/earth/blob/master/public/templates/il8n.json) (Localized content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser experience"]
  node_page["Map page<br/>[index.html]"]
  node_app["Earth application<br/>[earth.js]"]
  node_locale["Localized content<br/>[il8n.json]"]
end

subgraph group_state["View and configuration"]
  node_config["Map configuration<br/>[earth.js]"]
  node_hash["URL hash state<br/>[earth.js]"]
  node_globe["Globe projections<br/>[globes.js]"]
end

subgraph group_data["Geospatial data"]
  node_mapdata["TopoJSON maps<br/>[earth-topo.json]"]
  node_mobilemap["Mobile map data"]
  node_products["Weather products<br/>[products.js]"]
  node_weather["GFS wind grid"]
  node_currents["OSCAR currents"]
  node_catalog["Current catalog<br/>[catalog.json]"]
end

subgraph group_viz["Visualization"]
  node_grid["Grid and interpolation<br/>[products.js]"]
  node_field["Wind field<br/>[earth.js]"]
  node_particles["Particle animation<br/>[earth.js]"]
  node_overlay["Colored overlay<br/>[earth.js]"]
  node_locations["Location details<br/>[earth.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_page -->|"loads"| node_app
node_app -->|"reads"| node_locale
node_app -->|"initializes"| node_config
node_config -->|"syncs state"| node_hash
node_config -->|"sets view"| node_globe
node_app -->|"loads map"| node_mapdata
node_app -.->|"loads map"| node_mobilemap
node_app -->|"selects layer"| node_products
node_products -->|"reads grid"| node_weather
node_products -->|"reads grid"| node_currents
node_products -->|"looks up dates"| node_catalog
node_products -->|"builds grid"| node_grid
node_grid -->|"interpolates"| node_field
node_field -->|"updates animation"| node_particles
node_app -->|"dispatches updates"| node_overlay
node_field -->|"supplies field"| node_overlay
node_app -->|"handles selection"| node_locations

click node_page "https://github.com/cambecc/earth/blob/master/public/index.html"
click node_app "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_locale "https://github.com/cambecc/earth/blob/master/public/templates/il8n.json"
click node_config "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_hash "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_globe "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/globes.js"
click node_mapdata "https://github.com/cambecc/earth/blob/master/public/data/earth-topo.json"
click node_mobilemap "https://github.com/cambecc/earth/blob/master/public/data/earth-topo-mobile.json"
click node_products "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/products.js"
click node_weather "https://github.com/cambecc/earth/blob/master/public/data/weather/current/current-wind-surface-level-gfs-1.0.json"
click node_currents "https://github.com/cambecc/earth/blob/master/public/data/oscar/20140131-surface-currents-oscar-0.33.json"
click node_catalog "https://github.com/cambecc/earth/blob/master/public/data/oscar/catalog.json"
click node_grid "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/products.js"
click node_field "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_particles "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_overlay "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"
click node_locations "https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_page,node_app,node_locale toneBlue
class node_config,node_hash,node_globe toneAmber
class node_mapdata,node_mobilemap,node_products,node_weather,node_currents,node_catalog toneMint
class node_grid,node_field,node_particles,node_overlay,node_locations toneRose
class node_visitor toneIndigo
```

## Components

### Browser experience

- [Map page](https://github.com/cambecc/earth/blob/master/public/index.html): `public/index.html`
- [Earth application](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [Localized content](https://github.com/cambecc/earth/blob/master/public/templates/il8n.json): `public/templates/il8n.json`

### View and configuration

- [Map configuration](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [URL hash state](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [Globe projections](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/globes.js): `public/libs/earth/1.0.0/globes.js`

### Geospatial data

- [TopoJSON maps](https://github.com/cambecc/earth/blob/master/public/data/earth-topo.json): `public/data/earth-topo.json`
- [Mobile map data](https://github.com/cambecc/earth/blob/master/public/data/earth-topo-mobile.json): `public/data/earth-topo-mobile.json`
- [Weather products](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/products.js): `public/libs/earth/1.0.0/products.js`
- [GFS wind grid](https://github.com/cambecc/earth/blob/master/public/data/weather/current/current-wind-surface-level-gfs-1.0.json): `public/data/weather/current/current-wind-surface-level-gfs-1.0.json`
- [OSCAR currents](https://github.com/cambecc/earth/blob/master/public/data/oscar/20140131-surface-currents-oscar-0.33.json): `public/data/oscar/20140131-surface-currents-oscar-0.33.json`
- [Current catalog](https://github.com/cambecc/earth/blob/master/public/data/oscar/catalog.json): `public/data/oscar/catalog.json`

### Visualization

- [Grid and interpolation](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/products.js): `public/libs/earth/1.0.0/products.js`
- [Wind field](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [Particle animation](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [Colored overlay](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`
- [Location details](https://github.com/cambecc/earth/blob/master/public/libs/earth/1.0.0/earth.js): `public/libs/earth/1.0.0/earth.js`

### Other components

- **Visitor**

## Connections

- Visitor → Map page: opens
- Map page → Earth application: loads
- Earth application → Localized content: reads
- Earth application → Map configuration: initializes
- Map configuration → URL hash state: syncs state
- Map configuration → Globe projections: sets view
- Earth application → TopoJSON maps: loads map
- Earth application → Mobile map data: loads map
- Earth application → Weather products: selects layer
- Weather products → GFS wind grid: reads grid
- Weather products → OSCAR currents: reads grid
- Weather products → Current catalog: looks up dates
- Weather products → Grid and interpolation: builds grid
- Grid and interpolation → Wind field: interpolates
- Wind field → Particle animation: updates animation
- Earth application → Colored overlay: dispatches updates
- Wind field → Colored overlay: supplies field
- Earth application → Location details: handles selection
