Idea · Aug 12, 2026
Observable Algorithm Visualizer
A browser environment where students implement standard algorithms in JavaScript and a code instrumentation layer automatically generates step-by-step animated visualizations driven by the student's actual code execution, not hardcoded animations.
What it would do
Observable Algorithm Visualizer gives students a React sandbox with a thin instrumentation API: they import a handful of functions — highlight(index), swap(i, j), compare(a, b), setPhase(label) — and call them inside their sorting or graph algorithm implementation. The sandbox records every instrumentation call in execution order, then replays the log as an animated visualization where array bars or graph nodes respond directly to the student's code decisions. Because the visualization is driven by the student's own execution trace rather than a canonical reference implementation, incorrect algorithms produce visibly wrong animations — making bugs immediately legible. A diff view compares the student's trace log against a correct reference trace, highlighting the first divergence. Instructors configure which algorithms are in scope, the visualization components available (arrays, graphs, trees, queues), and the automated grading rubric that checks both correctness of output and correctness of the trace sequence. The assignment scales from a single sort (week 1) to a full suite (BFS, DFS, Dijkstra, quicksort) over a multi-week project. This is distinct from Algorithm Cinema (a passive side project viewer) and Algorithm Race (competitive speed focus).
Key features
- Thin instrumentation API (highlight, swap, compare, setPhase) students call inside their own algorithm code
- Replay engine that animates visualizations from the student's actual execution trace, not reference animations
- Diff view comparing student trace against correct reference trace, with first-divergence highlighted
- Instructor configurator: algorithm scope, available visualization components, rubric weights
- Automated grading: output correctness, trace correctness, and instrumentation usage quality