# robertus31/usvizualizations architecture

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

- Interactive diagram: https://gitdiagram.com/robertus31/usvizualizations
- Repository: https://github.com/robertus31/usvizualizations

## Overview

USVisualizations is an R Shiny application for visualizing publicly available data with Leaflet. The documented user workflow is to start the app with `run_app()` and open it in a browser; the README does not describe how the app server, map module, styling, popups, or bundled data connect internally. Those components are shown without speculative edges. The source excerpts were unavailable, so relationships are limited to those stated in the README.

Main entry points: [`R/run_app.R`](https://github.com/robertus31/usvizualizations/blob/master/R/run_app.R) (App launcher), [`R/app_ui.R`](https://github.com/robertus31/usvizualizations/blob/master/R/app_ui.R) (Shiny interface), [`app.R`](https://github.com/robertus31/usvizualizations/blob/master/app.R) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_run_app["App launcher<br/>[run_app.R]"]
  node_app_entry["App entry<br/>[app.R]"]
  node_app_config["App configuration<br/>[app_config.R]"]
  node_app_server["Shiny server<br/>[app_server.R]"]
  node_app_ui["Shiny interface<br/>[app_ui.R]"]
end

subgraph group_mapping["Map visualization"]
  node_map_view["Map view<br/>[mod_mapView.R]"]
  node_popups["Map popups<br/>[showPopups.R]"]
  node_stylings["Map styling<br/>[stylings.R]"]
  node_leaflet["Leaflet library"]
end

subgraph group_data["Bundled data"]
  node_monthly_data[("Monthly data<br/>[monthlyData.rda]")]
  node_usa_sf[("USA spatial data<br/>[usaSF.rda]")]
end

node_browser_user(("Browser user"))

node_browser_user -->|"starts app"| node_run_app
node_run_app -->|"starts"| node_app_entry
node_app_ui -->|"uses"| node_leaflet

click node_run_app "https://github.com/robertus31/usvizualizations/blob/master/R/run_app.R"
click node_app_entry "https://github.com/robertus31/usvizualizations/blob/master/app.R"
click node_app_config "https://github.com/robertus31/usvizualizations/blob/master/R/app_config.R"
click node_app_server "https://github.com/robertus31/usvizualizations/blob/master/R/app_server.R"
click node_app_ui "https://github.com/robertus31/usvizualizations/blob/master/R/app_ui.R"
click node_map_view "https://github.com/robertus31/usvizualizations/blob/master/R/mod_mapView.R"
click node_popups "https://github.com/robertus31/usvizualizations/blob/master/R/showPopups.R"
click node_stylings "https://github.com/robertus31/usvizualizations/blob/master/R/stylings.R"
click node_monthly_data "https://github.com/robertus31/usvizualizations/blob/master/data/monthlyData.rda"
click node_usa_sf "https://github.com/robertus31/usvizualizations/blob/master/data/usaSF.rda"

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_run_app,node_app_entry,node_app_config,node_app_server,node_app_ui,node_browser_user toneBlue
class node_map_view,node_popups,node_stylings,node_leaflet toneAmber
class node_monthly_data,node_usa_sf toneMint
```

## Components

### App runtime

- [App launcher](https://github.com/robertus31/usvizualizations/blob/master/R/run_app.R): `R/run_app.R`
- [App entry](https://github.com/robertus31/usvizualizations/blob/master/app.R): `app.R`
- [App configuration](https://github.com/robertus31/usvizualizations/blob/master/R/app_config.R): `R/app_config.R`
- [Shiny server](https://github.com/robertus31/usvizualizations/blob/master/R/app_server.R): `R/app_server.R`
- [Shiny interface](https://github.com/robertus31/usvizualizations/blob/master/R/app_ui.R): `R/app_ui.R`

### Map visualization

- [Map view](https://github.com/robertus31/usvizualizations/blob/master/R/mod_mapView.R): `R/mod_mapView.R`
- [Map popups](https://github.com/robertus31/usvizualizations/blob/master/R/showPopups.R): `R/showPopups.R`
- [Map styling](https://github.com/robertus31/usvizualizations/blob/master/R/stylings.R): `R/stylings.R`
- **Leaflet library**

### Bundled data

- [Monthly data](https://github.com/robertus31/usvizualizations/blob/master/data/monthlyData.rda): `data/monthlyData.rda`
- [USA spatial data](https://github.com/robertus31/usvizualizations/blob/master/data/usaSF.rda): `data/usaSF.rda`

### Other components

- **Browser user**

## Connections

- Browser user → App launcher: starts app (evidence: `README.md`)
- App launcher → App entry: starts (evidence: `README.md`)
- Shiny interface → Leaflet library: uses (evidence: `README.md`)
