How stephaneseng/dynamic-network-visualization-boost-graph-library works
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.