# idromerom714/visualiaciones_roya_cafe architecture

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

- Interactive diagram: https://gitdiagram.com/idromerom714/visualiaciones_roya_cafe
- Repository: https://github.com/idromerom714/visualiaciones_roya_cafe

## Overview

This repository is a Streamlit dashboard for exploring climate indicators and simulated coffee-rust and coffee-borer risk across farms. Users select a pathogen, date range, locations and climate variable; the app loads and joins climate, farm and disease-threshold CSVs, computes indicators, and presents aggregated metrics and visualizations. It also includes simulated incidence/count models, statistical regression and correlation analysis. A separate Folium module builds sampling-zone maps; the README describes map rendering as optional. The diagram follows the excerpts and README; unsampled app sections limit certainty about some internal calls.

Main entry points: [`app.py`](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py) (Streamlit dashboard), [`mapa_zonas.py`](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/mapa_zonas.py) (Sampling-zone map), [`data/clima_ubicaciones.csv`](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/data/clima_ubicaciones.csv) (Climate records), [`ubicaciones.csv`](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/ubicaciones.csv) (Farm locations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard workflow"]
  node_app["Streamlit dashboard<br/>[app.py]"]
  node_climate["Climate records"]
  node_farms["Farm locations<br/>[ubicaciones.csv]"]
  node_thresholds["Disease thresholds<br/>[enfermedades.csv]"]
  node_filtering["Date and farm filters<br/>[app.py]"]
  node_visuals["Risk charts and KPIs<br/>[app.py]"]
end

subgraph group_analysis["Risk analysis"]
  node_indicators["Climate indicators<br/>[app.py]"]
  node_rustsim["Rust incidence simulation<br/>[app.py]"]
  node_borersim["Borer count simulation<br/>[app.py]"]
  node_logit["Logistic regression<br/>[app.py]"]
  node_negativebinomial["Negative-binomial model<br/>[app.py]"]
  node_correlation["Correlation analysis<br/>[app.py]"]
end

subgraph group_mapping["Farm mapping"]
  node_mapmodule["Sampling-zone map<br/>[mapa_zonas.py]"]
  node_mapservice["Folium renderer"]
end

node_user(("Dashboard user"))

node_user -->|"selects filters"| node_app
node_app -->|"reads climate"| node_climate
node_app -->|"reads locations"| node_farms
node_app -->|"reads thresholds"| node_thresholds
node_app -->|"offers filters"| node_filtering
node_filtering -->|"filters climate"| node_indicators
node_app -->|"calculates"| node_indicators
node_app -->|"simulates rust"| node_rustsim
node_app -->|"simulates borers"| node_borersim
node_app -.->|"fits rust model"| node_logit
node_app -.->|"fits borer model"| node_negativebinomial
node_app -->|"renders results"| node_visuals
node_app -->|"computes correlations"| node_correlation
node_app -.->|"may use map"| node_mapmodule
node_mapmodule -->|"builds Folium map"| node_mapservice

click node_app "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_climate "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/data/clima_ubicaciones.csv"
click node_farms "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/ubicaciones.csv"
click node_thresholds "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/data/enfermedades.csv"
click node_filtering "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_indicators "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_rustsim "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_borersim "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_logit "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_negativebinomial "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_visuals "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_correlation "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py"
click node_mapmodule "https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/mapa_zonas.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_app,node_climate,node_farms,node_thresholds,node_filtering,node_visuals,node_user toneBlue
class node_indicators,node_rustsim,node_borersim,node_logit,node_negativebinomial,node_correlation toneAmber
class node_mapmodule,node_mapservice toneMint
```

## Components

### Dashboard workflow

- [Streamlit dashboard](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Climate records](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/data/clima_ubicaciones.csv): `data/clima_ubicaciones.csv`
- [Farm locations](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/ubicaciones.csv): `ubicaciones.csv`
- [Disease thresholds](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/data/enfermedades.csv): `data/enfermedades.csv`
- [Date and farm filters](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Risk charts and KPIs](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`

### Risk analysis

- [Climate indicators](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Rust incidence simulation](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Borer count simulation](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Logistic regression](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Negative-binomial model](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`
- [Correlation analysis](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/app.py): `app.py`

### Farm mapping

- [Sampling-zone map](https://github.com/idromerom714/visualiaciones_roya_cafe/blob/main/mapa_zonas.py): `mapa_zonas.py`
- **Folium renderer**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Streamlit dashboard: selects filters (evidence: `README.md`)
- Streamlit dashboard → Climate records: reads climate (evidence: `app.py`)
- Streamlit dashboard → Farm locations: reads locations (evidence: `app.py`)
- Streamlit dashboard → Disease thresholds: reads thresholds (evidence: `app.py`)
- Streamlit dashboard → Date and farm filters: offers filters (evidence: `app.py`)
- Date and farm filters → Climate indicators: filters climate (evidence: `app.py`)
- Streamlit dashboard → Climate indicators: calculates (evidence: `app.py`)
- Streamlit dashboard → Rust incidence simulation: simulates rust (evidence: `app.py`)
- Streamlit dashboard → Borer count simulation: simulates borers (evidence: `app.py`)
- Streamlit dashboard → Logistic regression: fits rust model (evidence: `app.py`)
- Streamlit dashboard → Negative-binomial model: fits borer model (evidence: `app.py`)
- Streamlit dashboard → Risk charts and KPIs: renders results (evidence: `app.py`)
- Streamlit dashboard → Correlation analysis: computes correlations (evidence: `app.py`)
- Streamlit dashboard → Sampling-zone map: may use map (evidence: `README.md`)
- Sampling-zone map → Folium renderer: builds Folium map (evidence: `mapa_zonas.py`)
