AlgoTrace is a next-generation algorithm visualizer built with React, TypeScript, and Framer Motion. It features a "Time-Travel" debugging engine that allows you to step forward, backward, and scrub through the execution of complex algorithms deterministically.
- 🕰️ Deterministic Time-Travel: Record every step of an algorithm's execution (Comparisons, Swaps, node visits) and replay it instantly. Scrub through the timeline with zero latency.
- 🎨 Multi-Structure Visualization:
- Array Visualizer: Beautiful, animated bar charts for sorting algorithms.
- Graph/Tree Visualizer: Force-directed graphs and tree layouts for non-linear structures.
- 💻 Integrated Code Editor:
- Full-featured Monaco Editor (VS Code engine).
- Write and execute your own JavaScript code directly in the browser.
- Syntax highlighting for Python, Java, and C++ (Reference modes).
- 💎 Modern Aesthetic:
- "Dark Glass" theme with glassmorphism cards and glowing accents.
- Smooth, spring-based animations powered by Framer Motion.
- 📦 Comprehensive Library:
- Sorting: Bubble, Selection, Insertion, Merge, Quick, Heap.
- Trees: BST, AVL, Red-Black, Splay.
- Graphs: (Coming Soon: BFS, DFS, Dijkstra).
- Frontend: React 18, TypeScript, Vite
- Styling: Vanilla CSS (Variables, Glassmorphism), Framer Motion
- Editor: @monaco-editor/react
- Engine: Custom Proxy-based JS Execution Engine
- Node.js (v18+ recommended)
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/algotrace.git cd algotrace -
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open
http://localhost:5173in your browser.
- Select an Algorithm: Use the dropdown menu to choose from Sorting or Tree algorithms.
- Choose Language: Toggle between JavaScript (Runnable), Python, Java, or C++ to see reference implementations.
- Input Data: Enter your own comma-separated numbers or hit the 🎲 Randomize button.
- Run: Click Run Code to compile and generate the trace.
- Control: Use the playback bar to Play (
▶), Pause (⏸), Reset (⏹), or scrub through the definition of the algorithm.
Contributions are welcome! Please fork the repository and submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.