How ayushdutta-ai/sorting-visualizer works
This is a browser-based sorting visualizer. Users generate a random array, choose a sorting algorithm, and watch the bars animate into sorted order while complexity figures update. The main script handles array generation and algorithm selection; each algorithm mutates shared array state and schedules visual updates through the visualization layer. The tree and sampled scripts support these runtime relationships, but the README is empty and the HTML was not sampled, so page details are limited to referenced controls and elements.
Main entry points: main.js Array and algorithm controls · visualizations.js Animation and speed · index.html Complexity display · bubble_sort.js Bubble sort
Components 13
Interface and controls
- Visualizer page
index.html - Array and algorithm controls
scripts/main.js - Complexity display
index.html
Sorting algorithms
- Bubble sort
scripts/bubble_sort.js - Selection sort
scripts/selection_sort.js - Insertion sort
scripts/insertion_sort.js - Merge sort
scripts/merge_sort.js - Quick sort
scripts/quick_sort.js - Heap sort
scripts/heap_sort.js
Animation and state
- Array bars
scripts/main.js - Array values
scripts/main.js - Animation and speed
scripts/visualizations.js
Other components
- User
Connections 30
- User → Visualizer page: uses
- Visualizer page → Array and algorithm controls: provides controls
- Array and algorithm controls → Array values: generates and updates
- Array and algorithm controls → Array bars: creates bars
- Array and algorithm controls → Bubble sort: dispatches
- Array and algorithm controls → Selection sort: dispatches
- Array and algorithm controls → Insertion sort: dispatches
- Array and algorithm controls → Merge sort: dispatches
- Array and algorithm controls → Quick sort: dispatches
- Array and algorithm controls → Heap sort: dispatches
- Bubble sort → Array values: mutates
- Selection sort → Array values: mutates
- Insertion sort → Array values: mutates
- Merge sort → Array values: mutates
- Quick sort → Array values: mutates
- Heap sort → Array values: mutates
- Bubble sort → Animation and speed: schedules updates
- Selection sort → Animation and speed: schedules updates
- Insertion sort → Animation and speed: schedules updates
- Merge sort → Animation and speed: schedules updates
- Quick sort → Animation and speed: schedules updates
- Heap sort → Animation and speed: schedules updates
- Animation and speed → Array bars: updates styles
- Animation and speed → Array and algorithm controls: reenables controls
- Bubble sort → Complexity display: writes complexity
- Selection sort → Complexity display: writes complexity
- Insertion sort → Complexity display: writes complexity
- Merge sort → Complexity display: writes complexity
- Quick sort → Complexity display: writes complexity
- Heap sort → Complexity display: writes complexity