# vinayakkumarr/algorithm-visualizer architecture

> Architecture diagram of the GitHub repository vinayakkumarr/algorithm-visualizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vinayakkumarr/algorithm-visualizer
- Repository: https://github.com/vinayakkumarr/algorithm-visualizer

## Overview

Algorithm Visualizer is a client-side learning application: users choose a topic from the catalog, open an interactive visualizer, configure input and playback, and inspect step-by-step state alongside pseudocode and theory. The routes connect topic pages to algorithm step generators and shared visualization components; theory-only topics use reference content instead. The README documents playback, presets, array views, narration, and deferred theory loading. Several page and algorithm implementations are unsampled, so those capability branches are shown at directory level and links are limited to documented or indexed evidence.

Main entry points: [`src/components/VisualizerLayout.jsx`](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/VisualizerLayout.jsx) (Visualizer shell), [`src/App.jsx`](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/App.jsx) (App routes), [`src/pages/algorithms`](https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/pages/algorithms) (Other topic pages), [`src/pages/algorithms/searching/BinarySearch.jsx`](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/algorithms/searching/BinarySearch.jsx) (Binary search page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and shell"]
  node_app["App routes<br/>[App.jsx]"]
  node_catalog["Topic catalog<br/>[Home.jsx]"]
end

subgraph group_visualization["Interactive visualization"]
  node_searchpage["Binary search page<br/>[BinarySearch.jsx]"]
  node_treepage["BST visualizer page<br/>[BSTInsertion.jsx]"]
  node_topicpages["Other topic pages"]
  node_layout["Visualizer shell"]
  node_searchview["Search display"]
  node_treeview["Tree display<br/>[TreeVisualizer.jsx]"]
  node_pseudocode["Pseudocode tracer"]
  node_narrator["Step narrator<br/>[StepNarrator.jsx]"]
  node_custominput["Custom array input"]
end

subgraph group_algorithms["Algorithm execution"]
  node_searchalgo["Search generators<br/>[binarySearch.js]"]
  node_sortalgo["Sorting generators"]
  node_listalgo["Linked-list generators"]
  node_treealgo["Tree generators<br/>[bstAlgorithms.js]"]
  node_graphalgo["Graph generators"]
  node_stackqueuealgo["Stack and queue generators"]
end

subgraph group_learning["Learning and reference"]
  node_theorypage["Theory topic pages"]
  node_theorysection["Theory reader<br/>[TheorySection.jsx]"]
  node_theorymanifest["Theory manifest<br/>[theoryManifest.js]"]
  node_theorydata["Theory content<br/>[theoryData.js]"]
end

subgraph group_state["Shared state"]
  node_visualizerstate["Playback context"]
  node_theme["Theme context<br/>[ThemeContext.jsx]"]
end

node_learner(("Learner"))
node_browserstorage[("Browser local storage")]

node_learner -->|"browses topics"| node_catalog
node_catalog -->|"opens route"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_searchpage
node_app -->|"routes to"| node_treepage
node_app -->|"routes to"| node_topicpages
node_searchpage -->|"generates steps"| node_searchalgo
node_searchpage -->|"renders shell"| node_layout
node_searchpage -->|"renders states"| node_searchview
node_treepage -->|"generates steps"| node_treealgo
node_treepage -->|"renders tree"| node_treeview
node_treepage -->|"renders guide"| node_theorysection
node_topicpages -.->|"uses generators"| node_sortalgo
node_topicpages -.->|"uses generators"| node_listalgo
node_topicpages -.->|"uses generators"| node_graphalgo
node_topicpages -.->|"uses generators"| node_stackqueuealgo
node_layout -->|"renders tracer"| node_pseudocode
node_layout -->|"renders narration"| node_narrator
node_layout -->|"opens modal"| node_custominput
node_layout -->|"provides context"| node_visualizerstate
node_layout -->|"resolves topic"| node_theorymanifest
node_layout -->|"shows theory"| node_theorysection
node_theorypage -.->|"renders guide"| node_theorysection
node_theorysection -->|"reads content"| node_theorydata
node_theorypage -.->|"loads topic data"| node_theorydata
node_app -->|"provides theme"| node_theme
node_theme -->|"persists preference"| node_browserstorage

click node_app "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/App.jsx"
click node_catalog "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/Home.jsx"
click node_searchpage "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/algorithms/searching/BinarySearch.jsx"
click node_treepage "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/algorithms/tree/BSTInsertion.jsx"
click node_topicpages "https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/pages/algorithms"
click node_layout "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/VisualizerLayout.jsx"
click node_searchview "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/SearchVisualizer.jsx"
click node_treeview "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/TreeVisualizer.jsx"
click node_pseudocode "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/PseudocodeViewer.jsx"
click node_narrator "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/StepNarrator.jsx"
click node_custominput "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/CustomArrayModal.jsx"
click node_searchalgo "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/binarySearch.js"
click node_sortalgo "https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms"
click node_listalgo "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/linkedListEngine.js"
click node_treealgo "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/bstAlgorithms.js"
click node_graphalgo "https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms"
click node_stackqueuealgo "https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms"
click node_theorypage "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/TheoryTopicPage.jsx"
click node_theorysection "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/TheorySection.jsx"
click node_theorymanifest "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/data/theoryManifest.js"
click node_theorydata "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/data/theoryData.js"
click node_visualizerstate "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/context/VisualizerContext.jsx"
click node_theme "https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/context/ThemeContext.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_catalog toneBlue
class node_searchpage,node_treepage,node_topicpages,node_layout,node_searchview,node_treeview,node_pseudocode,node_narrator,node_custominput,node_browserstorage toneAmber
class node_searchalgo,node_sortalgo,node_listalgo,node_treealgo,node_graphalgo,node_stackqueuealgo toneMint
class node_theorypage,node_theorysection,node_theorymanifest,node_theorydata toneRose
class node_visualizerstate,node_theme,node_learner toneIndigo
```

## Components

### Navigation and shell

- [App routes](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/App.jsx): `src/App.jsx`
- [Topic catalog](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`

### Interactive visualization

- [Binary search page](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/algorithms/searching/BinarySearch.jsx): `src/pages/algorithms/searching/BinarySearch.jsx`
- [BST visualizer page](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/algorithms/tree/BSTInsertion.jsx): `src/pages/algorithms/tree/BSTInsertion.jsx`
- [Other topic pages](https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/pages/algorithms): `src/pages/algorithms`
- [Visualizer shell](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/VisualizerLayout.jsx): `src/components/VisualizerLayout.jsx`
- [Search display](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/SearchVisualizer.jsx): `src/components/SearchVisualizer.jsx`
- [Tree display](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/TreeVisualizer.jsx): `src/components/TreeVisualizer.jsx`
- [Pseudocode tracer](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/PseudocodeViewer.jsx): `src/components/PseudocodeViewer.jsx`
- [Step narrator](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/StepNarrator.jsx): `src/components/StepNarrator.jsx`
- [Custom array input](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/CustomArrayModal.jsx): `src/components/CustomArrayModal.jsx`

### Algorithm execution

- [Search generators](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/binarySearch.js): `src/algorithms/binarySearch.js`
- [Sorting generators](https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms): `src/algorithms`
- [Linked-list generators](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/linkedListEngine.js): `src/algorithms/linkedListEngine.js`
- [Tree generators](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/algorithms/bstAlgorithms.js): `src/algorithms/bstAlgorithms.js`
- [Graph generators](https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms): `src/algorithms`
- [Stack and queue generators](https://github.com/vinayakkumarr/algorithm-visualizer/tree/main/src/algorithms): `src/algorithms`

### Learning and reference

- [Theory topic pages](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/pages/TheoryTopicPage.jsx): `src/pages/TheoryTopicPage.jsx`
- [Theory reader](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/components/TheorySection.jsx): `src/components/TheorySection.jsx`
- [Theory manifest](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/data/theoryManifest.js): `src/data/theoryManifest.js`
- [Theory content](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/data/theoryData.js): `src/data/theoryData.js`

### Shared state

- [Playback context](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/context/VisualizerContext.jsx): `src/context/VisualizerContext.jsx`
- [Theme context](https://github.com/vinayakkumarr/algorithm-visualizer/blob/main/src/context/ThemeContext.jsx): `src/context/ThemeContext.jsx`

### Other components

- **Learner**
- **Browser local storage**

## Connections

- Learner → Topic catalog: browses topics
- Topic catalog → App routes: opens route (evidence: `src/App.jsx`)
- App routes → Topic catalog: routes to (evidence: `src/App.jsx`)
- App routes → Binary search page: routes to (evidence: `src/App.jsx`)
- App routes → BST visualizer page: routes to (evidence: `src/App.jsx`)
- App routes → Other topic pages: routes to (evidence: `src/App.jsx`)
- Binary search page → Search generators: generates steps (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- Binary search page → Visualizer shell: renders shell (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- Binary search page → Search display: renders states (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- BST visualizer page → Tree generators: generates steps (evidence: `src/pages/algorithms/tree/BSTInsertion.jsx`)
- BST visualizer page → Tree display: renders tree (evidence: `src/pages/algorithms/tree/BSTInsertion.jsx`)
- BST visualizer page → Theory reader: renders guide (evidence: `src/pages/algorithms/tree/BSTInsertion.jsx`)
- Other topic pages → Sorting generators: uses generators (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- Other topic pages → Linked-list generators: uses generators (evidence: `src/pages/algorithms/stack/BalancedParens.jsx`)
- Other topic pages → Graph generators: uses generators (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- Other topic pages → Stack and queue generators: uses generators (evidence: `src/pages/algorithms/searching/BinarySearch.jsx`)
- Visualizer shell → Pseudocode tracer: renders tracer (evidence: `src/components/VisualizerLayout.jsx`)
- Visualizer shell → Step narrator: renders narration (evidence: `src/components/VisualizerLayout.jsx`)
- Visualizer shell → Custom array input: opens modal (evidence: `src/components/VisualizerLayout.jsx`)
- Visualizer shell → Playback context: provides context (evidence: `src/components/VisualizerLayout.jsx`)
- Visualizer shell → Theory manifest: resolves topic (evidence: `src/components/VisualizerLayout.jsx`)
- Visualizer shell → Theory reader: shows theory (evidence: `src/components/VisualizerLayout.jsx`)
- Theory topic pages → Theory reader: renders guide
- Theory reader → Theory content: reads content (evidence: `src/components/TheorySection.jsx`)
- Theory topic pages → Theory content: loads topic data
- App routes → Theme context: provides theme (evidence: `src/App.jsx`)
- Theme context → Browser local storage: persists preference (evidence: `src/context/ThemeContext.jsx`)
