{"id":50845925,"url":"https://github.com/edo1z/sort-visualizer","last_synced_at":"2026-06-14T09:30:54.906Z","repository":{"id":362081187,"uuid":"1256942487","full_name":"edo1z/sort-visualizer","owner":"edo1z","description":"Interactive sorting-algorithm visualizer - watch 15 sorts run, or write your own and get it scored live. Vanilla JS, no build.","archived":false,"fork":false,"pushed_at":"2026-06-02T12:57:37.000Z","size":15783,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T14:27:18.261Z","etag":null,"topics":["algorithm-visualization","canvas","computer-science","educational","javascript","sorting-algorithms","visualization","web-worker"],"latest_commit_sha":null,"homepage":"https://edo1z.github.io/sort-visualizer/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edo1z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T08:10:38.000Z","updated_at":"2026-06-02T12:58:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/edo1z/sort-visualizer","commit_stats":null,"previous_names":["edo1z/sort-visualizer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/edo1z/sort-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edo1z%2Fsort-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edo1z%2Fsort-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edo1z%2Fsort-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edo1z%2Fsort-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edo1z","download_url":"https://codeload.github.com/edo1z/sort-visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edo1z%2Fsort-visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34316823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm-visualization","canvas","computer-science","educational","javascript","sorting-algorithms","visualization","web-worker"],"created_at":"2026-06-14T09:30:54.235Z","updated_at":"2026-06-14T09:30:54.901Z","avatar_url":"https://github.com/edo1z.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sort-visualizer\n\n[![Live demo](https://img.shields.io/badge/live_demo-open-ff2d95?style=for-the-badge\u0026logo=github)](https://edo1z.github.io/sort-visualizer/)\n\u0026nbsp;[![License: MIT](https://img.shields.io/badge/license-MIT-00e5ff?style=for-the-badge)](LICENSE)\n\u0026nbsp;[![No build](https://img.shields.io/badge/build-none-39ff14?style=for-the-badge)](#run-locally)\n\nLearn sorting algorithms **by running them in your browser**. Watch 15 sorts race with\nadjustable speed — or **write your own `sort()` and get it scored live**.\n\n### ▶ [Open the live demo →](https://edo1z.github.io/sort-visualizer/)\n\n![sort-visualizer](assets/quick.gif)\n\n## Two modes\n\n### 👁 Watch\n- 15 algorithms visualized: Timsort, Quicksort, Merge, Heap … down to Bogosort\n- **Speed and array size** as live sliders (play / step / shuffle)\n- Live comparison \u0026 swap counts, plus each algorithm's complexity, use cases, and pros/cons\n\n### `\u003c/\u003e` Code\n- Implement `sort(a, viz)` yourself — your code animates exactly as written\n- Load any algorithm's **reference implementation** from the dropdown (read it, tweak it, run it)\n- Running it **scores your code** automatically:\n  - **Correctness** — random + edge-case tests\n  - **Operations** — comparison \u0026 swap counts\n  - **Complexity estimate** — doubles the array size, measures how operations grow, and infers `O(n²)` / `O(n log n)` etc.\n- Your code runs in a **Web Worker (isolated thread)** — it can't touch the page's DOM or cookies,\n  and infinite loops are force-stopped automatically. A safe sandbox for running untrusted code.\n\nThe `viz` API: compare `viz.gt(i,j)` / `viz.lt(i,j)`, swap `viz.swap(i,j)`, write `viz.set(i,v)`,\nread `viz.get(i)`. Only operations routed through `viz` animate the bars and count toward the score.\n\n## Run locally\nJust open `index.html` (no build, no dependencies — only the CodeMirror editor loads from a CDN).\n\n\u003e To guarantee the Worker-based sandbox, serve over HTTP:\n\u003e `python -m http.server` → `http://localhost:8000/`\n\n## Layout\n| File | Role |\n|---|---|\n| `index.html` | The app (UI + controls) |\n| `web/sorts.js` | The 15 Watch-mode sorts (generators that `yield` intermediate states) |\n| `web/meta.js` | Per-algorithm descriptions \u0026 complexity data |\n| `web/templates.js` | The Code-mode reference `sort(a, viz)` implementations |\n| `web/app.js` | Rendering, animation, controls, sandboxed runner |\n| `web/verify.js` / `web/verify-templates.js` | `node` tests that every sort actually sorts |\n| `sortviz/` + `generate.py` | (bonus) Python tool that renders the GIFs |\n\n## Tests\n```bash\nnode web/verify.js             # the 15 Watch-mode sorts\nnode web/verify-templates.js   # the 15 Code-mode reference templates\nuv run pytest                  # the Python GIF implementations\n```\n\n## Notes\n- Plain HTML/JS, no build step, no framework\n- User code runs in a Blob-based Web Worker (falls back to a sandboxed iframe where Workers are blocked);\n  a watchdog plus operation/frame caps stop runaway code\n- An algorithm is \"a generator that `yield`s states\"; rendering is shared — adding a sort is a one-file change\n\n## License\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedo1z%2Fsort-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedo1z%2Fsort-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedo1z%2Fsort-visualizer/lists"}