{"id":25878258,"url":"https://github.com/endeepak/simufast","last_synced_at":"2025-07-02T08:03:45.714Z","repository":{"id":57361604,"uuid":"401427791","full_name":"endeepak/simufast","owner":"endeepak","description":"Embeddable simulation widget for web. Learn and share fast with visual abstractions.","archived":false,"fork":false,"pushed_at":"2021-10-07T01:20:54.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T19:09:09.669Z","etag":null,"topics":["javascript","simulation"],"latest_commit_sha":null,"homepage":"https://tech.endeepak.com/blog/2021/09/22/visual-simulation-of-consistent-hashing/","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/endeepak.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}},"created_at":"2021-08-30T17:21:54.000Z","updated_at":"2024-04-21T19:47:38.000Z","dependencies_parsed_at":"2022-09-26T16:41:00.142Z","dependency_job_id":null,"html_url":"https://github.com/endeepak/simufast","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endeepak%2Fsimufast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endeepak%2Fsimufast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endeepak%2Fsimufast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endeepak%2Fsimufast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endeepak","download_url":"https://codeload.github.com/endeepak/simufast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385218,"owners_count":19792980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["javascript","simulation"],"created_at":"2025-03-02T12:23:07.516Z","updated_at":"2025-03-02T12:23:08.421Z","avatar_url":"https://github.com/endeepak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simufast\n\nSimulate fast using visual abstractions. This is an embeddable widget built using [createjs](https://createjs.com/) for graphics and animations in HTML canvas.\n\nThe idea of simulation was inspired by the amazing interactive posts like [this](https://ciechanow.ski/internal-combustion-engine/) by [@bciechanowski](https://twitter.com/bciechanowski)\n\n## Usage\n\n* Include the simufast JS and CSS files in your HTML page or [markdown](https://www.markdownguide.org/basic-syntax/#html).\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/simufast@0.0.6/src/simufast.css\"\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/simufast@0.0.6/dist/main.js\"\u003e\u003c/script\u003e\n```\n\n\u003e Note: This project is in the proof of concept stage. The APIs may change. Please use specific version of the js and css files to avoid breaking changes.\n\n* Add a `script` tag in HTML `body` with the simulation code. An example of bubble sort simulation is as below\n\n```html\n\u003cscript\u003e\n    const bubbleSort = async (items, options) =\u003e {\n      for (let i = 0; i \u003c items.length; i++) {\n          for (let j = 0; j \u003c items.length - i - 1; j++) {\n              if (await items.compareAtIndex(j, j + 1) \u003e 0) { // compares and highlights the elements being compared\n                  await items.swap(j, j + 1); // swaps and animates the elements being swapped\n              }\n              await options.onStepCompleted(); // allows pause \u0026 play\n          }\n      }\n    }\n\n    simufast.run((player) =\u003e { // embeds the simufast player\n      const items = simufast.array.createVisualArray(player, simufast.utils.randIntArray(9, 10, 99)); // draws the array\n      player.experiment({ // runs the experiments as per the commands\n          name: 'Bubble Sort',\n          drawable: items,\n          commands: [(options) =\u003e bubbleSort(items, options)]\n      });\n    });\n\u003c/script\u003e\n```\n\nCheckout one of the below examples in [JSBin](https://jsbin.com/tazuwuz/edit?html,output) to try your own.\n\n## Examples\n\n* Visual Array\n  * [Bubble sort](https://jsbin.com/tazuwuz/edit?html,output)\n  * [Selection sort](https://jsbin.com/nequjey/edit?html,output)\n  * [Quick Sort](https://jsbin.com/jezamut/edit?html,output)\n* Consistent Hashing\n  * [Blog](https://tech.endeepak.com/blog/2021/09/22/visual-simulation-of-consistent-hashing) (Embedded in static HTML generated via OctoPress)\n  * [JSBin](https://jsbin.com/fuvavun/edit?html,output)\n  * [Blog](https://endeepak.medium.com/a-visual-guide-to-consistent-hashing-e47cdfe70db5) (Embedded in medium.com using CodePen)\n  * [Blog](https://dev.to/endeepak/visual-simulation-of-consistent-hashing-dbd) (Embedded in dev.to using JSFiddle)\n\n## How to run and test locally\n\n```\nnpm install\nnpm run build:dev\nopen index.html\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendeepak%2Fsimufast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendeepak%2Fsimufast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendeepak%2Fsimufast/lists"}