# csvistool/visualization-tool architecture

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

- Interactive diagram: https://gitdiagram.com/csvistool/visualization-tool
- Repository: https://github.com/csvistool/visualization-tool

## Overview

##### Project Type and Purpose
- This is a single‐page, front‐end React application (no dedicated backend) for visualizing data structures and algorithms. It’s hosted as a static site (GitHub Pages) and serves as an interactive teaching tool for CS1332.

##### File Structure Analysis
- Top‐Level Folders
- public – static assets (index.html, 404, CNAME, images, robots.txt)
- src – source code, subdivided into:
– algo – implementations of DS/A algorithms + util helpers
– anim – animation primitives & orchestration
– components – shared UI pieces (Header, Footer, buttons, search filter, not‐found)
– screens – page‐level containers (HomeScreen, AlgoScreen, AboutScreen)
– modals – pop‐up dialogs (BigO, info)
– examples – example usage (ExampleModals.js)
– css – styling
– img/audio – static media
– pseudocode.json, time_complexities.json – data sources

- Config & Tooling
- package.json / lock – dependencies (React, ESLint, Prettier)
- .github/workflows/nodejs.yml – CI: linting & builds
- .eslintrc, .prettierrc – code style

##### README Insights
- Confirms front‐end React rewrite of an existing DS/A visualizer
- No server or database; purely static SPA

##### Diagramming the Architecture
a. Main Components
1. Static Hosting (GitHub Pages)
2. Browser Client – loads index.html → App.js
3. React App Root
- Screens (HomeScreen, AlgoScreen, AboutScreen)
- Shared Components (Header, Footer, SearchFilter, SideButton, AlgorithmNotFound404)
- Modals (BigO, Info)
4. Visualization Engine
- algo package – data structures & algorithm logic
- anim package – visual primitives & animation sequencing
- Data Sources – pseudocode.json, time_complexities.json
5. Assets – CSS files, images, audio

b. Relationships & Interactions
- Browser → index.html → React App root
- App.js orchestrates routing between screens
- Each Screen pulls in:
– Components for UI layout
– algo/index.js to fetch and run algorithms
– anim/AnimationMain & ObjectManager to render visuals
– modals for additional info overlays
- algo modules may call util helpers (PriorityQueue, GraphValues)
- anim modules dispatch CustomEvents for play/pause/undo

c. Architectural Patterns & Principles
- Component-based UI (React) – separation of concerns
- Feature grouping (screens vs. algo vs. anim vs. UI)
- Unidirectional data flow – App state → props → child components
- Static asset hosting – no server layer

d. Key Technologies
- React (functional components, hooks)
- JavaScript ES6 modules
- GitHub Pages for deployment
- ESLint, Prettier for code quality

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Hosting and CI
    subgraph "External Systems"
        GHPages["Static Hosting\n(GitHub Pages)"]:::ext
        CI["CI & Build\n(.github/workflows/nodejs.yml)"]:::ci
    end

    GHPages -->|deploys| Browser["Browser Client"]:::ext
    CI -->|build & deploy| GHPages

    %% Client Entry
    Browser --> Index["src/index.js"]:::static
    Index --> App["src/App.js"]:::ui

    %% React App Layers
    subgraph "React Application"
        direction TB

        %% Screens Layer
        subgraph "Screens (Blue)"
            HomeScreen["HomeScreen"]:::ui
            AlgoScreen["AlgoScreen"]:::ui
            AboutScreen["AboutScreen"]:::ui
        end

        %% Shared UI Components
        subgraph "Shared UI Components (Blue)"
            Header["Header"]:::ui
            Footer["Footer"]:::ui
            SearchFilter["SearchFilter"]:::ui
            SideButton["SideButton"]:::ui
            NotFound["AlgorithmNotFound404"]:::ui
        end

        %% Modals
        subgraph "Modals (Blue)"
            BigO["BigO Modal"]:::ui
            Info["Info Modal"]:::ui
        end

        %% Algorithm Logic
        subgraph "Algorithm Logic (Green)"
            AlgoIndex["src/algo/index.js"]:::algo
            UTIL["Utility Helpers"]:::algo
        end

        %% Animation Engine
        subgraph "Animation Engine (Orange)"
            AnimationMain["AnimationMain"]:::anim
            ObjectManager["ObjectManager"]:::anim
            CustomEvents["CustomEvents"]:::anim
            SingleAnimation["SingleAnimation"]:::anim
            Primitives["Animated Primitives"]:::anim
        end

        %% Data Sources & Assets
        subgraph "Data & Assets (Gray)"
            Pseudo["pseudocode.json"]:::data
            Complexities["time_complexities.json"]:::data
            CSS["CSS Styles"]:::static
            Images["Images & Audio"]:::static
        end
    end

    %% Connections within React App
    App --> HomeScreen
    App --> AlgoScreen
    App --> AboutScreen

    HomeScreen --> Header
    HomeScreen --> Footer
    HomeScreen --> SearchFilter
    HomeScreen --> SideButton
    HomeScreen --> NotFound

    AlgoScreen --> Header
    AlgoScreen --> Footer
    AlgoScreen --> NotFound

    AboutScreen --> Header
    AboutScreen --> Footer

    HomeScreen --> AlgoIndex
    AlgoScreen --> AlgoIndex

    HomeScreen --> AnimationMain
    AlgoScreen --> AnimationMain

    HomeScreen --> BigO
    HomeScreen --> Info
    AlgoScreen --> BigO
    AlgoScreen --> Info

    AlgoIndex --> UTIL
    UTIL -->|helper functions| AlgoIndex

    AnimationMain --> ObjectManager
    AnimationMain --> CustomEvents
    AnimationMain --> SingleAnimation
    SingleAnimation --> Primitives
    ObjectManager --> CustomEvents

    AlgoIndex --> Pseudo
    AlgoIndex --> Complexities

    App --> CSS
    App --> Images

    %% Legend
    subgraph "Legend"
        direction LR
        U["UI Components"]:::ui
        A["Algorithm Logic"]:::algo
        M["Animation Engine"]:::anim
        D["Data & Assets"]:::data
        E["External"]:::ext
        C["CI"]:::ci
    end

    %% Click Events
    click GHPages "https://github.com/csvistool/visualization-tool/tree/master/public/"
    click Browser "https://github.com/csvistool/visualization-tool/blob/master/src/index.js"
    click Index "https://github.com/csvistool/visualization-tool/blob/master/src/index.js"
    click App "https://github.com/csvistool/visualization-tool/blob/master/src/App.js"
    click HomeScreen "https://github.com/csvistool/visualization-tool/blob/master/src/screens/HomeScreen.js"
    click AlgoScreen "https://github.com/csvistool/visualization-tool/blob/master/src/screens/AlgoScreen.js"
    click AboutScreen "https://github.com/csvistool/visualization-tool/blob/master/src/screens/AboutScreen.js"
    click Header "https://github.com/csvistool/visualization-tool/blob/master/src/components/Header.js"
    click Footer "https://github.com/csvistool/visualization-tool/blob/master/src/components/Footer.js"
    click SearchFilter "https://github.com/csvistool/visualization-tool/blob/master/src/components/HomeScreen/SearchFilter.js"
    click SideButton "https://github.com/csvistool/visualization-tool/blob/master/src/components/HomeScreen/SideButton.js"
    click NotFound "https://github.com/csvistool/visualization-tool/blob/master/src/components/AlgorithmNotFound404.js"
    click BigO "https://github.com/csvistool/visualization-tool/blob/master/src/modals/BigOModals.js"
    click Info "https://github.com/csvistool/visualization-tool/blob/master/src/modals/InfoModals.js"
    click AnimationMain "https://github.com/csvistool/visualization-tool/blob/master/src/anim/AnimationMain.js"
    click ObjectManager "https://github.com/csvistool/visualization-tool/blob/master/src/anim/ObjectManager.js"
    click CustomEvents "https://github.com/csvistool/visualization-tool/blob/master/src/anim/CustomEvents.js"
    click SingleAnimation "https://github.com/csvistool/visualization-tool/blob/master/src/anim/SingleAnimation.js"
    click Primitives "https://github.com/csvistool/visualization-tool/tree/master/src/anim/"
    click AlgoIndex "https://github.com/csvistool/visualization-tool/blob/master/src/algo/index.js"
    click UTIL "https://github.com/csvistool/visualization-tool/blob/master/src/algo/util/PriorityQueue.js"
    click Pseudo "https://github.com/csvistool/visualization-tool/blob/master/src/pseudocode.json"
    click Complexities "https://github.com/csvistool/visualization-tool/blob/master/src/time_complexities.json"
    click CSS "https://github.com/csvistool/visualization-tool/blob/master/src/css/App.css"
    click Images "https://github.com/csvistool/visualization-tool/tree/master/src/img/"

    %% Styles
    classDef ui fill:#e0f0ff,stroke:#0066cc,color:#003366
    classDef algo fill:#e0ffe0,stroke:#009900,color:#006600
    classDef anim fill:#fff4e6,stroke:#ff9900,color:#cc6600
    classDef data fill:#f0f0f0,stroke:#999999,color:#666666
    classDef static fill:#f9f9f9,stroke:#cccccc,color:#666666
    classDef ext fill:#f0e6ff,stroke:#9900cc,color:#660066
    classDef ci fill:#ffe6e6,stroke:#cc0000,color:#990000
```
