# pacificclimate/chyp architecture

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

- Interactive diagram: https://gitdiagram.com/pacificclimate/chyp
- Repository: https://github.com/pacificclimate/chyp

## Overview

CHYP is an interactive British Columbia hydrology portal. Users explore water features on a map, search the Freshwater Atlas, select a feature, then download its GeoJSON or model timeseries—including upstream/downstream network data. The graph also preserves the point-plotting, help, and map-legend capabilities. Source excerpts show the main UI composition and download/API calls; relationships for some map internals are supported by the SOURCE INDEX or README rather than full implementation excerpts.

Main entry points: [`app/src/components/map/MapComponent.jsx`](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/MapComponent.jsx) (Interactive map), [`app/src/components/map/InteractionLayer.jsx`](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/InteractionLayer.jsx) (Feature interaction), [`app/src/components/data/DataSelectionTable.jsx`](https://github.com/pacificclimate/chyp/blob/main/app/src/components/data/DataSelectionTable.jsx) (Data selection panel), [`app/src/components/map/FwaNameSearch.jsx`](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/FwaNameSearch.jsx) (FWA name search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_map["Map exploration"]
  node_app["Application shell<br/>[App.jsx]"]
  node_mapview["Interactive map<br/>[MapComponent.jsx]"]
  node_interaction["Feature interaction"]
  node_search["FWA name search<br/>[FwaNameSearch.jsx]"]
  node_fwaindex["FWA name index<br/>[fwa_index.json]"]
  node_renderer["Vector tile renderer"]
  node_styles["Map styles<br/>[styles.js]"]
  node_basemapconfig["Base map config<br/>[baseMapConfig.js]"]
end

subgraph group_data["Data downloads"]
  node_selection["Data selection panel"]
  node_download["Browser downloads<br/>[downloadFile.js]"]
end

subgraph group_support["Map support"]
  node_pointplotter["Point plotter<br/>[PointPlotter.jsx]"]
  node_legend["Network legend<br/>[NetworkLegend.jsx]"]
  node_help["Help guide<br/>[HelpGuide.jsx]"]
  node_logo["Project branding<br/>[LogoBox.jsx]"]
end

subgraph group_services["Data services"]
  node_timeseries["Timeseries API client<br/>[timeseriesApi.js]"]
  node_network["Stream network client<br/>[streamNetApi.js]"]
  node_geojson["Network GeoJSON client<br/>[geoJsonApi.js]"]
  node_bcgw["BCGW map service"]
  node_bbox["BBOX server"]
  node_hydromosaic["Hydromosaic API"]
  node_basetiles["Base map tiles"]
end

node_user(("Portal user"))

node_user -->|"opens portal"| node_app
node_app -->|"renders"| node_mapview
node_mapview -->|"renders"| node_interaction
node_mapview -->|"renders"| node_search
node_mapview -->|"renders"| node_pointplotter
node_mapview -->|"renders"| node_legend
node_mapview -->|"renders"| node_help
node_mapview -->|"renders"| node_logo
node_mapview -->|"uses styles"| node_styles
node_mapview -->|"uses config"| node_basemapconfig
node_mapview -.->|"loads tiles"| node_basetiles
node_search -->|"searches index"| node_fwaindex
node_search -->|"queries features"| node_bcgw
node_interaction -->|"uses renderer"| node_renderer
node_interaction -->|"fetches feature"| node_bbox
node_interaction -->|"fetches networks"| node_network
node_interaction -->|"requests GeoJSON"| node_geojson
node_interaction -->|"renders panel"| node_selection
node_interaction -->|"downloads GeoJSON"| node_download
node_selection -->|"requests options"| node_timeseries
node_selection -->|"requests downloads"| node_timeseries
node_selection -->|"starts download"| node_download
node_geojson -->|"fetches network pages"| node_bbox
node_timeseries -->|"requests data"| node_hydromosaic

click node_app "https://github.com/pacificclimate/chyp/blob/main/app/src/App.jsx"
click node_mapview "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/MapComponent.jsx"
click node_interaction "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/InteractionLayer.jsx"
click node_search "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/FwaNameSearch.jsx"
click node_fwaindex "https://github.com/pacificclimate/chyp/blob/main/app/public/fwa_index.json"
click node_renderer "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/vectorGridCanvasRenderer.js"
click node_styles "https://github.com/pacificclimate/chyp/blob/main/app/src/styles.js"
click node_basemapconfig "https://github.com/pacificclimate/chyp/blob/main/app/src/baseMapConfig.js"
click node_pointplotter "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/PointPlotter.jsx"
click node_legend "https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/NetworkLegend.jsx"
click node_help "https://github.com/pacificclimate/chyp/blob/main/app/src/components/info/HelpGuide.jsx"
click node_logo "https://github.com/pacificclimate/chyp/blob/main/app/src/components/info/LogoBox.jsx"
click node_selection "https://github.com/pacificclimate/chyp/blob/main/app/src/components/data/DataSelectionTable.jsx"
click node_download "https://github.com/pacificclimate/chyp/blob/main/app/src/utils/downloadFile.js"
click node_timeseries "https://github.com/pacificclimate/chyp/blob/main/app/src/services/timeseriesApi.js"
click node_network "https://github.com/pacificclimate/chyp/blob/main/app/src/services/streamNetApi.js"
click node_geojson "https://github.com/pacificclimate/chyp/blob/main/app/src/services/geoJsonApi.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_app,node_mapview,node_interaction,node_search,node_fwaindex,node_renderer,node_styles,node_basemapconfig,node_user toneBlue
class node_selection,node_download toneAmber
class node_pointplotter,node_legend,node_help,node_logo toneMint
class node_timeseries,node_network,node_geojson,node_bcgw,node_bbox,node_hydromosaic,node_basetiles toneRose
```

## Components

### Map exploration

- [Application shell](https://github.com/pacificclimate/chyp/blob/main/app/src/App.jsx): `app/src/App.jsx`
- [Interactive map](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/MapComponent.jsx): `app/src/components/map/MapComponent.jsx`
- [Feature interaction](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/InteractionLayer.jsx): `app/src/components/map/InteractionLayer.jsx`
- [FWA name search](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/FwaNameSearch.jsx): `app/src/components/map/FwaNameSearch.jsx`
- [FWA name index](https://github.com/pacificclimate/chyp/blob/main/app/public/fwa_index.json): `app/public/fwa_index.json`
- [Vector tile renderer](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/vectorGridCanvasRenderer.js): `app/src/components/map/vectorGridCanvasRenderer.js`
- [Map styles](https://github.com/pacificclimate/chyp/blob/main/app/src/styles.js): `app/src/styles.js`
- [Base map config](https://github.com/pacificclimate/chyp/blob/main/app/src/baseMapConfig.js): `app/src/baseMapConfig.js`

### Data downloads

- [Data selection panel](https://github.com/pacificclimate/chyp/blob/main/app/src/components/data/DataSelectionTable.jsx): `app/src/components/data/DataSelectionTable.jsx`
- [Browser downloads](https://github.com/pacificclimate/chyp/blob/main/app/src/utils/downloadFile.js): `app/src/utils/downloadFile.js`

### Map support

- [Point plotter](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/PointPlotter.jsx): `app/src/components/map/PointPlotter.jsx`
- [Network legend](https://github.com/pacificclimate/chyp/blob/main/app/src/components/map/NetworkLegend.jsx): `app/src/components/map/NetworkLegend.jsx`
- [Help guide](https://github.com/pacificclimate/chyp/blob/main/app/src/components/info/HelpGuide.jsx): `app/src/components/info/HelpGuide.jsx`
- [Project branding](https://github.com/pacificclimate/chyp/blob/main/app/src/components/info/LogoBox.jsx): `app/src/components/info/LogoBox.jsx`

### Data services

- [Timeseries API client](https://github.com/pacificclimate/chyp/blob/main/app/src/services/timeseriesApi.js): `app/src/services/timeseriesApi.js`
- [Stream network client](https://github.com/pacificclimate/chyp/blob/main/app/src/services/streamNetApi.js): `app/src/services/streamNetApi.js`
- [Network GeoJSON client](https://github.com/pacificclimate/chyp/blob/main/app/src/services/geoJsonApi.js): `app/src/services/geoJsonApi.js`
- **BCGW map service**
- **BBOX server**
- **Hydromosaic API**
- **Base map tiles**

### Other components

- **Portal user**

## Connections

- Portal user → Application shell: opens portal (evidence: `README.md`)
- Application shell → Interactive map: renders (evidence: `app/src/App.jsx`)
- Interactive map → Feature interaction: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → FWA name search: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Point plotter: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Network legend: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Help guide: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Project branding: renders (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Map styles: uses styles (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Base map config: uses config (evidence: `app/src/components/map/MapComponent.jsx`)
- Interactive map → Base map tiles: loads tiles (evidence: `README.md`)
- FWA name search → FWA name index: searches index (evidence: `README.md`)
- FWA name search → BCGW map service: queries features (evidence: `app/src/components/map/FwaNameSearch.jsx`)
- Feature interaction → Vector tile renderer: uses renderer (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Feature interaction → BBOX server: fetches feature (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Feature interaction → Stream network client: fetches networks (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Feature interaction → Network GeoJSON client: requests GeoJSON (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Feature interaction → Data selection panel: renders panel (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Feature interaction → Browser downloads: downloads GeoJSON (evidence: `app/src/components/map/InteractionLayer.jsx`)
- Data selection panel → Timeseries API client: requests options (evidence: `app/src/components/data/DataSelectionTable.jsx`)
- Data selection panel → Timeseries API client: requests downloads (evidence: `app/src/components/data/DataSelectionTable.jsx`)
- Data selection panel → Browser downloads: starts download (evidence: `app/src/components/data/DataSelectionTable.jsx`)
- Network GeoJSON client → BBOX server: fetches network pages (evidence: `app/src/services/geoJsonApi.js`)
- Timeseries API client → Hydromosaic API: requests data (evidence: `app/src/services/timeseriesApi.js`)
