# r-niemans/vds_visuals2425 architecture

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

- Interactive diagram: https://gitdiagram.com/r-niemans/vds_visuals2425
- Repository: https://github.com/r-niemans/vds_visuals2425

## Overview

##### Project type and purpose
- This is a data-visualization web application built in Python.
- It consumes raw football match and player data (CSV) to generate static and interactive charts, then serves them via a simple web interface (app.py).

##### File structure
- Top-level scripts and entry point:
- app.py – the Flask (or similar) server that ties everything together
- Jupyter notebook (VDS2425_Football.ipynb) – for exploratory analysis
- plot-generation scripts (bar_and_violin_plot.py, heatmap.py, scatterplot.py, etc.)
- Data directories:
- data/ – raw source CSVs for Country, League, Match, Player, Team, etc.
- grouped_players/ and filtered CSVs – intermediate data derived from raw inputs
- Output assets:
- figures/ – JSON or serialized plot objects for reuse in the app
- assets/ – static files (CSS, JS, images) used by the front end
- Configuration / metadata:
- README.md – minimal, project name only
- .idea/ – IDE settings (can be ignored for architecture)

##### Extract insights from the README
- Project name “vds_visuals2425” implies “visualizations for VDS 2425 (a football dataset).”

##### Main components
a. Data Layer
- Raw CSV files in data/
- Preprocessing scripts that read raw data and write grouped_players/ and filtered CSVs
b. Processing & Visualization Layer
- Standalone Python scripts and notebooks that generate:
– Static charts (bar_and_violin_plot.py, heatmap.py, scatterplot.py)
– Interactive charts (bar_and_violin_interactive.py)
- Output stored as JSON or Python objects in figures/
c. Web Application Layer
- app.py – reads precomputed figures or regenerates plots on demand
- assets/ – static front-end resources (JS libraries for interactivity, CSS)
- Templates or HTML endpoints (implied inside app.py)
d. Client Layer
- Browser – requests pages, loads interactive charts via JS

##### Architectural patterns and principles
- Modular separation:
- Data extraction/prep scripts isolated from web-serving logic
- Visualization logic separated into self-contained scripts
- Reusability: pre-generated figures live in figures/ so the web app need not rerun heavy plotting on every request
- Single codebase monolith: no microservices, everything runs under one Python process

##### Technologies, frameworks, and libraries
- Python 3.x
- Flask (or lightweight HTTP server within app.py)
- Plotting libraries: Matplotlib/Seaborn for static, Plotly for interactive
- Pandas for CSV ingestion and DataFrame manipulation
- JSON for serializing interactive figures

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Layer
    subgraph "Data Layer"
        raw["Raw CSV Files"]:::data
        filtered["Filtered Player Info CSV"]:::data
        grouped["Grouped Players Data"]:::data
    end

    %% Processing & Visualization Layer
    subgraph "Processing & Visualization Layer"
        barviolin["bar_and_violin_plot.py"]:::process
        heatmap["heatmap.py"]:::process
        scatter["scatterplot.py"]:::process
        interactive["bar_and_violin_interactive.py"]:::process
        notebook["VDS2425_Football.ipynb"]:::process
    end

    %% Generated Figures
    subgraph "Generated Figures"
        figures["Figure Objects (JSON/Python)"]:::process
    end

    %% Web Application Layer
    subgraph "Web Application Layer"
        app["Flask App (app.py)"]:::web
        assets["Static Front-End Assets"]:::web
        readme["README.md"]:::meta
    end

    %% Client Layer
    client["Client Browser"]:::client

    %% Annotation
    perf("Precompute figures for performance"):::note

    %% Connections
    raw -->|"CSV"| barviolin
    raw -->|"CSV"| heatmap
    raw -->|"CSV"| scatter
    raw -->|"CSV"| interactive
    filtered -->|"CSV"| barviolin
    filtered -->|"CSV"| heatmap
    filtered -->|"CSV"| scatter
    filtered -->|"CSV"| interactive
    grouped -->|"CSV"| barviolin
    grouped -->|"CSV"| heatmap
    grouped -->|"CSV"| scatter
    grouped -->|"CSV"| interactive

    barviolin -->|"chart objects (JSON)"| figures
    heatmap -->|"chart objects (JSON)"| figures
    scatter -->|"chart objects (JSON)"| figures
    interactive -->|"interactive JSON"| figures

    figures -->|"load figures"| app
    assets -->|"serve assets"| app
    app -->|"HTTP"| client

    perf -.-> figures

    %% Click Events
    click raw "https://github.com/r-niemans/vds_visuals2425/tree/main/data/"
    click filtered "https://github.com/r-niemans/vds_visuals2425/blob/main/data/filtered_player_info.csv"
    click grouped "https://github.com/r-niemans/vds_visuals2425/tree/main/grouped_players/"
    click barviolin "https://github.com/r-niemans/vds_visuals2425/blob/main/bar_and_violin_plot.py"
    click heatmap "https://github.com/r-niemans/vds_visuals2425/blob/main/heatmap.py"
    click scatter "https://github.com/r-niemans/vds_visuals2425/blob/main/scatterplot.py"
    click interactive "https://github.com/r-niemans/vds_visuals2425/blob/main/bar_and_violin_interactive.py"
    click notebook "https://github.com/r-niemans/vds_visuals2425/blob/main/VDS2425_Football.ipynb"
    click figures "https://github.com/r-niemans/vds_visuals2425/tree/main/figures/"
    click app "https://github.com/r-niemans/vds_visuals2425/blob/main/app.py"
    click assets "https://github.com/r-niemans/vds_visuals2425/tree/main/assets/"
    click readme "https://github.com/r-niemans/vds_visuals2425/blob/main/README.md"

    %% Styles
    classDef data fill:#aed9e0,stroke:#333,stroke-width:1px
    classDef process fill:#c8e6c9,stroke:#333,stroke-width:1px
    classDef web fill:#ffcc80,stroke:#333,stroke-width:1px
    classDef client fill:#fff59d,stroke:#333,stroke-width:1px
    classDef meta fill:#eeeeee,stroke:#333,stroke-width:1px
    classDef note fill:#ffd54f,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
