项目作者: vicrazumov

项目描述 :
Visualise your sorting (or any other array transforming) algorithm in javascript
高级语言: JavaScript
项目地址: git://github.com/vicrazumov/sort-viz.git
创建时间: 2019-07-14T18:14:05Z
项目社区:https://github.com/vicrazumov/sort-viz

开源协议:

下载


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