How sowbyspencer/circuitsimulator works
Circuit Simulator is a client-side diagramming app for building electrical circuits and viewing their simulated behavior. A user adds source and load cards, edits their settings, connects or rearranges wires, and the canvas app solves the DC circuit and updates displayed readings. The app also advances load temperature over time and shows overvoltage or burnout state. The README documents additional simulation features and local JSON persistence; those subsystems are represented, but their implementation and wiring were not shown in the sampled source.
Main entry points: App.jsx Canvas app · circuit.js DC circuit solver · main.jsx Browser entry · engine Additional physics
Components 12
Diagram canvas
- Browser entry
src/main.jsx - Canvas app
src/App.jsx - DC source card
src/components/DcSourceNode.jsx - DC load card
src/components/DcLoadNode.jsx
Circuit editing
- Node actions
src/appActions.js - Wire actions
src/engine/wireActions.js
Simulation engine
- DC circuit solver
src/engine/circuit.js - Load thermal model
src/engine/loadThermal.js - Additional physics
src/engine - Protection and conversion
src/engine
Persistence
- Local JSON files
src
Other components
- Circuit designer
Connections 14
- Circuit designer → Browser entry: opens app
README.md - Browser entry → Canvas app: renders
src/main.jsx - Circuit designer → Canvas app: edits diagram
README.md - Canvas app → DC source card: renders
src/App.jsx - Canvas app → DC load card: renders
src/App.jsx - Canvas app → Node actions: delegates edits
src/App.jsx - Canvas app → Wire actions: delegates wiring
src/App.jsx - Canvas app → DC circuit solver: solves circuit
src/App.jsx - DC circuit solver → Canvas app: returns readings
src/App.jsx - Canvas app → Load thermal model: steps heating
src/App.jsx - Canvas app → Additional physics: uses physics
src/App.jsx - Canvas app → Local JSON files: persists diagram
README.md - Canvas app → Protection and conversion: simulates features
README.md - DC circuit solver → Additional physics: models limits