# peixotoh/radioactivity-app architecture

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

- Interactive diagram: https://gitdiagram.com/peixotoh/radioactivity-app
- Repository: https://github.com/peixotoh/radioactivity-app

## Overview

This is a Streamlit visualizer for radioactive-dispersion simulations. Users choose a plant and date; the app retrieves the matching simulation data, converts its KML contours into colored GeoJSON, then presents a map and population-impact views. GeoJSON map download and raw exposure-table download are documented capabilities. The sampled source is a single application file, so these are logical responsibilities rather than separate modules; the impact-view implementation is only partly shown.

Main entry points: [`ib.py`](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py) (Simulation retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenario["Scenario selection"]
  node_scenario_controls["Plant and date<br/>[ib.py]"]
end

subgraph group_processing["Data retrieval and processing"]
  node_data_retrieval["Simulation retrieval<br/>[ib.py]"]
  node_kml_conversion["KML conversion<br/>[ib.py]"]
  node_contour_processing["Contour processing<br/>[ib.py]"]
  node_impact_data["Impact data<br/>[ib.py]"]
end

subgraph group_views["Visualization and results"]
  node_map_view["Dispersion map<br/>[ib.py]"]
  node_geojson_download["GeoJSON download<br/>[ib.py]"]
  node_impact_chart["Impact chart<br/>[ib.py]"]
  node_results_table["Exposure table<br/>[ib.py]"]
end

node_user(("User"))
node_simulation_source["Biosphere data"]

node_user -->|"chooses scenario"| node_scenario_controls
node_scenario_controls -->|"selects simulation"| node_data_retrieval
node_data_retrieval -->|"fetches simulation"| node_simulation_source
node_data_retrieval -->|"converts KML"| node_kml_conversion
node_kml_conversion -->|"provides layers"| node_contour_processing
node_contour_processing -->|"renders contours"| node_map_view
node_contour_processing -->|"exports GeoJSON"| node_geojson_download
node_data_retrieval -->|"reads impact data"| node_impact_data
node_impact_data -->|"displays impact chart"| node_impact_chart
node_impact_data -->|"displays exposure table"| node_results_table

click node_scenario_controls "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_data_retrieval "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_kml_conversion "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_contour_processing "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_impact_data "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_map_view "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_geojson_download "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_impact_chart "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"
click node_results_table "https://github.com/peixotoh/radioactivity-app/blob/main/ib.py"

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_scenario_controls,node_user toneBlue
class node_data_retrieval,node_kml_conversion,node_contour_processing,node_impact_data toneAmber
class node_map_view,node_geojson_download,node_impact_chart,node_results_table toneMint
class node_simulation_source toneIndigo
```

## Components

### Scenario selection

- [Plant and date](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`

### Data retrieval and processing

- [Simulation retrieval](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [KML conversion](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [Contour processing](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [Impact data](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`

### Visualization and results

- [Dispersion map](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [GeoJSON download](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [Impact chart](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`
- [Exposure table](https://github.com/peixotoh/radioactivity-app/blob/main/ib.py): `ib.py`

### Other components

- **User**
- **Biosphere data**

## Connections

- User → Plant and date: chooses scenario (evidence: `ib.py`)
- Plant and date → Simulation retrieval: selects simulation (evidence: `ib.py`)
- Simulation retrieval → Biosphere data: fetches simulation (evidence: `ib.py`)
- Simulation retrieval → KML conversion: converts KML (evidence: `ib.py`)
- KML conversion → Contour processing: provides layers (evidence: `ib.py`)
- Contour processing → Dispersion map: renders contours (evidence: `ib.py`)
- Contour processing → GeoJSON download: exports GeoJSON (evidence: `ib.py`)
- Simulation retrieval → Impact data: reads impact data (evidence: `ib.py`)
- Impact data → Impact chart: displays impact chart (evidence: `README.md`)
- Impact data → Exposure table: displays exposure table (evidence: `README.md`)
