# fdzul/densnv architecture

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

- Interactive diagram: https://gitdiagram.com/fdzul/densnv
- Repository: https://github.com/fdzul/densnv

## Overview

densnv is an R package for exploratory analysis of Mexican SINAVE vector-borne disease data, producing tables, graphs and maps to support prevention and control decisions. Its documented capabilities span dataset loading and case aggregation, geocoding, visualization, and epidemiological analysis. The README describes active-foci analysis as combining space-time clustering, a Knox test, Rt estimation and scenario diagnosis; it explicitly connects that analysis to rt_dengue(). Source excerpts were unavailable, so other relationships are limited to those documented in the README.

Main entry points: [`R/mp_active_foci.R`](https://github.com/fdzul/densnv/blob/main/R/mp_active_foci.R) (Active foci analysis), [`R/rt_dengue.R`](https://github.com/fdzul/densnv/blob/main/R/rt_dengue.R) (Rt estimation), [`R/read_dengue_dataset.R`](https://github.com/fdzul/densnv/blob/main/R/read_dengue_dataset.R) (Dataset loading), [`R/cases_by_loc.R`](https://github.com/fdzul/densnv/blob/main/R/cases_by_loc.R) (Case aggregation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset_read["Dataset loading"]
  node_case_agg["Case aggregation<br/>[cases_by_loc.R]"]
  node_weekly_cases["Weekly cases<br/>[cases_week.R]"]
  node_age_cases["Age-group cases<br/>[cases_by_agem.R]"]
  node_config_table["Configuration tables<br/>[tb_inst.R]"]
end

subgraph group_viz["Visualization"]
  node_plot_suite["Statistical plots<br/>[plt_heatmap.R]"]
  node_case_maps["Case maps<br/>[mp_cases_loc.R]"]
  node_heat_maps["Heat maps<br/>[mp_heatmap.R]"]
  node_animated_maps["Animated maps<br/>[mp_animated_loc.R]"]
  node_serotype_maps["Serotype maps<br/>[mp_serotype.R]"]
  node_bump_map["Bump map<br/>[mp_bumpmap.R]"]
  node_treemap_plot["Treemap plot<br/>[plt_treemap.R]"]
end

subgraph group_epi["Epidemiological analysis"]
  node_active_foci["Active foci analysis<br/>[mp_active_foci.R]"]
  node_rt_estimate["Rt estimation<br/>[rt_dengue.R]"]
end

subgraph group_geo["Geocoding"]
  node_geocode_prep["Geocode preparation<br/>[data_geocode.R]"]
  node_geocoder["Geocoding<br/>[geocode.R]"]
  node_geocode_save["Save geocodes<br/>[save_geocode.R]"]
end

node_analyst(("Program analyst"))
node_outputs["Analysis outputs"]

node_analyst -->|"loads data"| node_dataset_read
node_analyst -->|"aggregates cases"| node_case_agg
node_analyst -->|"summarizes weeks"| node_weekly_cases
node_analyst -->|"groups by age"| node_age_cases
node_analyst -->|"prepares addresses"| node_geocode_prep
node_analyst -->|"geocodes cases"| node_geocoder
node_analyst -->|"saves geocodes"| node_geocode_save
node_analyst -->|"analyzes foci"| node_active_foci
node_active_foci -->|"estimates Rt"| node_rt_estimate
node_analyst -->|"estimates Rt"| node_rt_estimate
node_analyst -->|"creates tables"| node_config_table
node_analyst -->|"creates graphs"| node_plot_suite
node_analyst -->|"maps cases"| node_case_maps
node_analyst -->|"creates heat maps"| node_heat_maps
node_analyst -->|"creates animations"| node_animated_maps
node_analyst -->|"maps serotypes"| node_serotype_maps
node_analyst -->|"creates bump map"| node_bump_map
node_analyst -->|"creates treemap"| node_treemap_plot
node_active_foci -->|"returns results"| node_outputs
node_rt_estimate -->|"returns Rt"| node_outputs

click node_dataset_read "https://github.com/fdzul/densnv/blob/main/R/read_dengue_dataset.R"
click node_case_agg "https://github.com/fdzul/densnv/blob/main/R/cases_by_loc.R"
click node_weekly_cases "https://github.com/fdzul/densnv/blob/main/R/cases_week.R"
click node_age_cases "https://github.com/fdzul/densnv/blob/main/R/cases_by_agem.R"
click node_geocode_prep "https://github.com/fdzul/densnv/blob/main/R/data_geocode.R"
click node_geocoder "https://github.com/fdzul/densnv/blob/main/R/geocode.R"
click node_geocode_save "https://github.com/fdzul/densnv/blob/main/R/save_geocode.R"
click node_active_foci "https://github.com/fdzul/densnv/blob/main/R/mp_active_foci.R"
click node_rt_estimate "https://github.com/fdzul/densnv/blob/main/R/rt_dengue.R"
click node_config_table "https://github.com/fdzul/densnv/blob/main/R/tb_inst.R"
click node_plot_suite "https://github.com/fdzul/densnv/blob/main/R/plt_heatmap.R"
click node_case_maps "https://github.com/fdzul/densnv/blob/main/R/mp_cases_loc.R"
click node_heat_maps "https://github.com/fdzul/densnv/blob/main/R/mp_heatmap.R"
click node_animated_maps "https://github.com/fdzul/densnv/blob/main/R/mp_animated_loc.R"
click node_serotype_maps "https://github.com/fdzul/densnv/blob/main/R/mp_serotype.R"
click node_bump_map "https://github.com/fdzul/densnv/blob/main/R/mp_bumpmap.R"
click node_treemap_plot "https://github.com/fdzul/densnv/blob/main/R/plt_treemap.R"

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_dataset_read,node_case_agg,node_weekly_cases,node_age_cases,node_config_table toneBlue
class node_plot_suite,node_case_maps,node_heat_maps,node_animated_maps,node_serotype_maps,node_bump_map,node_treemap_plot toneAmber
class node_active_foci,node_rt_estimate toneMint
class node_geocode_prep,node_geocoder,node_geocode_save toneRose
class node_analyst,node_outputs toneIndigo
```

## Components

### Data preparation

- [Dataset loading](https://github.com/fdzul/densnv/blob/main/R/read_dengue_dataset.R): `R/read_dengue_dataset.R`
- [Case aggregation](https://github.com/fdzul/densnv/blob/main/R/cases_by_loc.R): `R/cases_by_loc.R`
- [Weekly cases](https://github.com/fdzul/densnv/blob/main/R/cases_week.R): `R/cases_week.R`
- [Age-group cases](https://github.com/fdzul/densnv/blob/main/R/cases_by_agem.R): `R/cases_by_agem.R`
- [Configuration tables](https://github.com/fdzul/densnv/blob/main/R/tb_inst.R): `R/tb_inst.R`

### Visualization

- [Statistical plots](https://github.com/fdzul/densnv/blob/main/R/plt_heatmap.R): `R/plt_heatmap.R`
- [Case maps](https://github.com/fdzul/densnv/blob/main/R/mp_cases_loc.R): `R/mp_cases_loc.R`
- [Heat maps](https://github.com/fdzul/densnv/blob/main/R/mp_heatmap.R): `R/mp_heatmap.R`
- [Animated maps](https://github.com/fdzul/densnv/blob/main/R/mp_animated_loc.R): `R/mp_animated_loc.R`
- [Serotype maps](https://github.com/fdzul/densnv/blob/main/R/mp_serotype.R): `R/mp_serotype.R`
- [Bump map](https://github.com/fdzul/densnv/blob/main/R/mp_bumpmap.R): `R/mp_bumpmap.R`
- [Treemap plot](https://github.com/fdzul/densnv/blob/main/R/plt_treemap.R): `R/plt_treemap.R`

### Epidemiological analysis

- [Active foci analysis](https://github.com/fdzul/densnv/blob/main/R/mp_active_foci.R): `R/mp_active_foci.R`
- [Rt estimation](https://github.com/fdzul/densnv/blob/main/R/rt_dengue.R): `R/rt_dengue.R`

### Geocoding

- [Geocode preparation](https://github.com/fdzul/densnv/blob/main/R/data_geocode.R): `R/data_geocode.R`
- [Geocoding](https://github.com/fdzul/densnv/blob/main/R/geocode.R): `R/geocode.R`
- [Save geocodes](https://github.com/fdzul/densnv/blob/main/R/save_geocode.R): `R/save_geocode.R`

### Other components

- **Program analyst**
- **Analysis outputs**

## Connections

- Program analyst → Dataset loading: loads data (evidence: `README.md`)
- Program analyst → Case aggregation: aggregates cases (evidence: `README.md`)
- Program analyst → Weekly cases: summarizes weeks (evidence: `README.md`)
- Program analyst → Age-group cases: groups by age (evidence: `README.md`)
- Program analyst → Geocode preparation: prepares addresses (evidence: `README.md`)
- Program analyst → Geocoding: geocodes cases (evidence: `README.md`)
- Program analyst → Save geocodes: saves geocodes (evidence: `README.md`)
- Program analyst → Active foci analysis: analyzes foci (evidence: `README.md`)
- Active foci analysis → Rt estimation: estimates Rt (evidence: `README.md`)
- Program analyst → Rt estimation: estimates Rt (evidence: `README.md`)
- Program analyst → Configuration tables: creates tables (evidence: `README.md`)
- Program analyst → Statistical plots: creates graphs (evidence: `README.md`)
- Program analyst → Case maps: maps cases (evidence: `README.md`)
- Program analyst → Heat maps: creates heat maps (evidence: `README.md`)
- Program analyst → Animated maps: creates animations (evidence: `README.md`)
- Program analyst → Serotype maps: maps serotypes (evidence: `README.md`)
- Program analyst → Bump map: creates bump map (evidence: `README.md`)
- Program analyst → Treemap plot: creates treemap (evidence: `README.md`)
- Active foci analysis → Analysis outputs: returns results (evidence: `README.md`)
- Rt estimation → Analysis outputs: returns Rt (evidence: `README.md`)
