# stephaneseng/dynamic-network-visualization-boost-graph-library architecture

> Architecture diagram of the GitHub repository stephaneseng/dynamic-network-visualization-boost-graph-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stephaneseng/dynamic-network-visualization-boost-graph-library
- Repository: https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library

## Overview

##### Project Type & Purpose
- This is a visualization tool for dynamic networks that reads event-based data from CSV files (vertices and edges) and generates a live or animated graph visualization.
- The use of Boost Graph Library combined with OpenGL indicates that the core focus is on efficiently managing graph data and rendering the visual state dynamically over time.

##### File Structure
- Top-Level Files:
- LICENSE, Makefile, and README.md are standard. The Makefile is used for building the project.
- The doc directory includes sample data (vertices.csv, edges.csv) and even a sample GIF showing animation output.
- The src Directory:
- main.cpp: Contains the entry point of the application.
- graph.hpp: Likely defines the core graph data structure, possibly wrapping Boost graph types.
- graph_animator.cpp/hpp: Handles the timing and animation of the network as it updates over the specified timeline.
- graph_event_queue.cpp/hpp: Manages a queue of events chronologically – reflecting changes or interactions in the network over time.
- graph_renderer.cpp/hpp: Responsible for drawing the graph using OpenGL, interfacing via GLFW.

a. Data Input & Preparation:
- CSV Data Files: Represented by "doc/vertices.csv" and "doc/edges.csv". They serve as the primary data source.
- Data Parsing Module (could be part of main.cpp or a dedicated function): This module reads the CSV files and passes the structured data into the graph construction process.

b. Graph Representation & Management:
- Graph Module (graph.hpp): Represents the internal graph structure. It probably encapsulates or is built on top of the Boost Graph Library.
- Graph Event Queue (graph_event_queue.*): Manages the ordering of events that affect the graph dynamically.

c. Dynamic Animation & Rendering:
- Graph Animator (graph_animator.*): Controls the chronological progression of graph changes (e.g., adding or removing nodes/edges based on timestamps).
- Graph Renderer (graph_renderer.*): Uses OpenGL (and indirectly GLFW) to display the visual state of the network. This is where the animated rendering occurs.

d. Application Entry Point:
- main.cpp: Acts as the orchestrator. It handles command-line arguments (like start_date and end_date), initializes the data, and wires together the components.

e. External Dependencies:
- Boost Graph Library (for graph management)
- OpenGL & GLFW (for rendering)
- Boost Date-Time and Program Options libraries (for handling time-based events and command-line option parsing)

##### Relationships and Interactions
- The main application (in main.cpp) begins by parsing command-line arguments for the CSV paths and date ranges.
- It then loads the CSV files and constructs the graph using the Graph Module.
- The Graph Event Queue organizes the timeline of graph updates.
- The Graph Animator periodically updates the graph state by processing events from the queue.
- The Graph Renderer continuously draws the current state of the graph using OpenGL.
- External libraries (Boost and GLFW) support these operations, providing graph management and rendering functionalities, respectively.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Application Layer
    AppEntry["Application Entry Point"]:::app
    BoostOpts["Boost Date-Time&ProgramOptions"]:::external

    %% Data Input Layer
    subgraph "Data Input"
        vertices["vertices.csv"]:::data
        edges["edges.csv"]:::data
        CSVParser["CSV Parser(DataParsing)"]:::data
        vertices --> CSVParser
        edges --> CSVParser
    end

    %% Graph Management Layer
    subgraph "Graph Management"
        GraphModule["Graph Module(BoostGraphLibrary)"]:::management
        GraphEventQueue["Graph Event Queue(EventManagement)"]:::management
        GraphModule --> GraphEventQueue
    end

    %% Animation & Rendering Layer
    subgraph "Animation & Rendering"
        GraphAnimator["Graph Animator(AnimationController)"]:::animate
        GraphRenderer["Graph Renderer(VisualizationModule)"]:::animate
        GraphAnimator --> GraphRenderer
    end

    %% External Dependencies
    BoostLib["Boost Graph Library"]:::external
    OpenGL["OpenGL/GLFW"]:::external

    %% Connections between Layers
    AppEntry --> CSVParser
    CSVParser --> GraphModule
    GraphModule --> GraphAnimator
    GraphEventQueue --> GraphAnimator
    GraphAnimator --> GraphRenderer

    %% Connections to External Dependencies
    BoostOpts --> AppEntry
    BoostLib --> GraphModule
    OpenGL --> GraphRenderer

    %% Click Events
    click AppEntry "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/main.cpp"
    click vertices "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/doc/vertices.csv"
    click edges "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/doc/edges.csv"
    click GraphModule "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph.hpp"
    click GraphEventQueue "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_event_queue.cpp"
    click GraphEventQueue "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_event_queue.hpp"
    click GraphAnimator "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_animator.cpp"
    click GraphAnimator "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_animator.hpp"
    click GraphRenderer "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_renderer.cpp"
    click GraphRenderer "https://github.com/stephaneseng/dynamic-network-visualization-boost-graph-library/blob/master/src/graph_renderer.hpp"

    %% Styles
    classDef app fill:#f4cccc,stroke:#c00,stroke-width:2px;
    classDef data fill:#d9ead3,stroke:#6aa84f,stroke-width:2px;
    classDef management fill:#c9daf8,stroke:#1155cc,stroke-width:2px;
    classDef animate fill:#fff2cc,stroke:#f1c232,stroke-width:2px;
    classDef external fill:#ead1dc,stroke:#b97a57,stroke-width:2px;
```
