Python execution happens via Pyodide in a Web Worker. You drag blocks onto a canvas, wire them up, and hit run. The simulation streams results to live plots in real-time. You can also view and edit the generated Python code directly.
No server, no account, no install. Everything runs in your browser.
Some things that might be interesting from a technical perspective:
- The simulation runs in a streaming loop at 10 Hz in the worker, decoupled from the UI render loop (also 10 Hz max). Results accumulate in a queue and get batch-rendered via requestAnimationFrame. The simulation never blocks on plot rendering.
- Wire routing uses A* pathfinding on a grid with obstacle avoidance, similar to how Simulink routes wires. Users can add manual waypoints to override the automatic routing.
- The whole block library is auto-extracted from PathSim's Python source at build time. Adding a new block type is just adding a class name to a JSON config and running the extraction script.
Built with SvelteKit 5, SvelteFlow, Pyodide, Plotly.js, and CodeMirror 6.