Workalgovision-studio-python-pyqt6

AlgoVision Studio

I built AlgoVision Studio, an offline desktop app that teaches sorting algorithms.

Role
Python Developer
Timeline
Jul 2026
Main stack
Python
Links
Private
AlgoVision Studio — Python project screenshot

Overview

I built AlgoVision Studio, an offline desktop app that teaches sorting algorithms. It animates Bubble, Selection, Insertion, Merge, Quick and Heap sort on bars, highlights the matching pseudocode line, shows live comparison and swap counts, and can run two or more algorithms side by side on the same data.

It is written in Python with PyQt6 and Matplotlib.

Problem

Sorting algorithms are hard to learn from code and static diagrams. Students need to see each comparison and swap, step backwards when they miss something, and compare how two algorithms behave on the same data, ideally in a classroom with no internet connection.

Approach

I split the app into an engine and an interface. Each algorithm is a generator that yields an event for every comparison, swap and write. A recorder runs it to the end once and keeps a snapshot of the array for every step. The interface only reads from that finished list, so a timeline slider, step back, variable speed and side-by-side comparison all become simple lookups.

Outcome

Sorting algorithms
6
Tests, all passing
97
Playback speed
0.25x to 8x
Keyboard shortcuts
11
Lines of Python
~2k
Network calls
0

What I built

  • Animated bar visualization with colours for unsorted, comparing, active, swapping and sorted elements
  • Six algorithms: Bubble, Selection, Insertion, Merge, Quick and Heap sort
  • Pseudocode panel that highlights the line for the current step
  • Live statistics: comparisons, swaps, array accesses, current step and textbook complexity
  • Comparison mode that runs two or more algorithms side by side on the same dataset
  • Timeline slider, step forward and back, reset and playback speed from 0.25x to 8x
  • Datasets: presets (random, nearly sorted, reversed, few unique), random with a size slider, custom values, or CSV import
  • Light and dark themes, and a fullscreen presentation mode for teaching
  • Save and load sessions as JSON, and export performance statistics to CSV
  • Keyboard shortcuts for every main action
  • A pytest suite covering the algorithms, datasets, persistence and a UI smoke test

Architecture

System architecture

Diagram: sorting algorithms, a trace recorder and a player feed the PyQt6 interface.
The engine knows nothing about the interface. The interface knows nothing about how a sort works. Open full size ↗

Recording a trace

Diagram: run, event, snapshot and trace.
An algorithm runs once. The interface replays the recorded steps, so going backwards costs nothing. Open full size ↗

Comparison mode

Diagram: pick algorithms, same data, traces and a shared clock.
Algorithms with different step counts share one progress value and move side by side. Open full size ↗

Sessions and exports

Diagram: run, save, load and export.
Sessions restore the whole teaching setup, and exports accumulate results across runs. Open full size ↗

Engineering decisions

  1. 01Algorithms as generators

    Each sort yields an event after every comparison, swap and write. The algorithm stays readable as ordinary code, and the interface never has to be threaded into its loop.

  2. 02Record the whole run first

    Arrays are capped at 300 elements, so a full trace is cheap to build and keeps a snapshot at every step. In return, the timeline slider, step back and speed changes cost nothing.

  3. 03A shared clock for comparison

    Every trace is read by a single progress value from 0 to 1. Algorithms with different step counts move side by side without any synchronization code.

  4. 04An engine with no Qt in it

    The sorting, trace, dataset, session and export code imports nothing from Qt. It is tested without a display, and the interface can change without touching it.

  5. 05Honest limits

    Dataset size is capped at 300 elements on purpose. It is a teaching tool, not a benchmark, and the README says so.

AlgoVision Studio running Bubble Sort with the pseudocode panel and live statistics.

Need something similar?

Tell me what you are building and I will reply within one working day.

Start a project
↑↓ navigate↵ openesc closeCtrl K toggles this menu