Skip to content

Visualise your sorting (or any other array transforming) algorithm in javascript

Notifications You must be signed in to change notification settings

vicrazumov/sort-viz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting visualizer

Takes your javascript code, applies it to a random array of numbers and visualises the changes step by step.

Quick sort

What's interesting?

  1. it uses JS Proxies to register each transformation of an array, that will become a frame in animation
  2. it moves the execution of a customer script to a separate thread in order to keep the main thread unlocked (e.g., if you need to sort 10M items) Pay attention: running 3rd party code this way is insecure.
  3. it creates a web worker with a custom code on the fly by using a Blob API.

Usage

  1. clone the repo and run a static http-server from this folder
  2. by default, it uses a quick sort algorithm. You can update this in index.html.
  3. by default, it uses an array of 1000 random numbers. Adjust that in index.js

About

Visualise your sorting (or any other array transforming) algorithm in javascript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published