# wokech/afro_dataviz architecture

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

- Interactive diagram: https://gitdiagram.com/wokech/afro_dataviz
- Repository: https://github.com/wokech/afro_dataviz

## Overview

##### Project type and purpose
- This is a data-visualization pipeline repository focused on African topics. It comprises a set of independent “sub_projects” (labeled sub_pro_1 through sub_pro_24) each containing:
- raw datasets (CSV, XLSX, etc.)
- one or more R scripts that:
– load/clean/process data
– generate one or more charts or images
- optional images or processed files
- A utility subproject (sub_pro_0_tutorials_tools) provides shared R functions, helper scripts, and lookup tables.
- The end goal is to publish visual artifacts (PNG, SVG) on social media (Instagram, Linktree) and in reports.

##### File structure
- Top-level:
- .gitignore, README.md, R project file
- sub_pro_0_tutorials_tools (reusable code + data)
- sub_pro_[1–24] (thematic projects)
- Each thematic subproject follows the same pattern:
- datasets/ (raw CSV/XLSX)
- r_scripts/ (one or more R scripts)
- images/ or processed_datasets/ (optional output)
- No central “app” or web server—this is a batch pipeline.
- Version control: Git tracks code, data, and outputs.

##### README for additional insights
- Confirms the purpose: concise data vis for policymakers/general public.

##### Detailed capture of essential elements
- Don’t lump all sub_pro_* together—illustrate one representative pipeline and annotate “+ N more modules.”
- Sub_pro_0 as a library that multiple modules import.
- Rproj and Git at the center as the orchestrator.
- Versions of data (raw vs. processed) if processed_datasets are generated.

- The modular, repeatable nature of each topic’s pipeline
- The central shared-code library
- The flow from raw data to published visualizations
- The role of Git and external hosting in the publication workflow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Source Data Layer
    subgraph "Source Data Layer"
        direction TB
        RawDatasets["Raw Datasets\n(sub_pro_[1–24]/datasets)"]:::datastore
        LookupTables["Lookup Tables\n(africa_iso2_iso3.xlsx)"]:::datastore
    end

    %% Processing & Visualization Layer
    subgraph "Processing & Visualization Layer"
        direction TB
        subgraph "Shared Library"
            direction TB
            Camcorder["camcorder.R"]:::process
            SixFxns["six_fundamental_fxns.R"]:::process
            Flourish["flourish_charts.R"]:::process
            RegionalGroup["african_regional_groupings.R"]:::process
        end
        subgraph "Thematic Module Examples\n(+ 23 more)"
            direction TB
            Alcohol["alcohol_east_africa.R"]:::process
            FastGrow["africa_fast_grow_1.R"]:::process
            Blackmarble["blackmarbleR_1.R"]:::process
            GoogleTraffic["googletraffic_R_1.R"]:::process
        end
    end

    %% Output Layer
    subgraph "Output Layer"
        direction TB
        Images["Generated Images\n(PNG, SVG)"]:::output
        ProcessedDatasets["Processed Datasets\n(CSV)"]:::output
    end

    %% Version Control & Orchestration
    GitRepo["Git Repository\n(.gitignore, README.md, Rproj)"]:::git

    %% Publishing / Delivery
    subgraph "Publishing / Delivery"
        direction TB
        GitHubPages["GitHub Pages"]:::external
        Instagram["Instagram"]:::external
        Linktree["Linktree"]:::external
    end

    %% Connections
    RawDatasets -->|"input data"| Alcohol
    RawDatasets -->|"input data"| FastGrow
    RawDatasets -->|"input data"| Blackmarble
    RawDatasets -->|"input data"| GoogleTraffic
    LookupTables -->|"lookup functions"| Camcorder
    Camcorder -->|"shared logic"| Alcohol
    SixFxns -->|"shared logic"| Alcohol
    Flourish -->|"shared logic"| Alcohol
    RegionalGroup -->|"shared logic"| Alcohol

    Alcohol -->|"generates"| Images
    FastGrow -->|"generates"| Images
    Blackmarble -->|"generates"| Images
    GoogleTraffic -->|"generates"| Images
    Alcohol -->|"generates"| ProcessedDatasets

    Alcohol -->|"versioned in"| GitRepo
    FastGrow -->|"versioned in"| GitRepo
    Blackmarble -->|"versioned in"| GitRepo
    GoogleTraffic -->|"versioned in"| GitRepo
    Images -->|"versioned in"| GitRepo
    ProcessedDatasets -->|"versioned in"| GitRepo
    LookupTables -->|"versioned in"| GitRepo
    Camcorder -->|"versioned in"| GitRepo

    GitRepo -->|"publishes"| GitHubPages
    Images -->|"publishes"| Instagram
    Images -->|"publishes"| Linktree

    %% Click Events
    click LookupTables "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_0_tutorials_tools/africa_iso2_iso3.xlsx"
    click RawDatasets "https://github.com/wokech/afro_dataviz/tree/master/sub_pro_10_alcohol_owid/datasets/"
    click Camcorder "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_0_tutorials_tools/camcorder.R"
    click SixFxns "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_0_tutorials_tools/six_fundamental_fxns.R"
    click Flourish "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_0_tutorials_tools/flourish_charts.R"
    click RegionalGroup "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_0_tutorials_tools/african_regional_groupings.R"
    click Alcohol "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_10_alcohol_owid/r_scripts/alcohol_east_africa.R"
    click FastGrow "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_11_africa_fast_grow_ft/r_scripts/africa_fast_grow_1.R"
    click Blackmarble "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_17_blackmarbleR/r_scripts/blackmarbleR_1.R"
    click GoogleTraffic "https://github.com/wokech/afro_dataviz/blob/master/sub_pro_18_googletraffic_R/r_scripts/googletraffic_R_1.R"
    click Images "https://github.com/wokech/afro_dataviz/tree/master/sub_pro_11_africa_fast_grow_ft/images/"
    click ProcessedDatasets "https://github.com/wokech/afro_dataviz/tree/master/sub_pro_5_africa_economy_wiki/processed_datasets/"

    %% Styles
    classDef datastore fill:#FFEB3B,stroke:#FBC02D,stroke-width:2,shape:cylinder
    classDef process fill:#90CAF9,stroke:#1E88E5,stroke-width:2,shape:roundrect
    classDef output fill:#A5D6A7,stroke:#2E7D32,stroke-width:2,shape:rect
    classDef git fill:#B39DDB,stroke:#7E57C2,stroke-width:2,shape:rect
    classDef external fill:#EF9A9A,stroke:#C62828,stroke-width:2,shape:cloud
```
