Electric Field of Dreams

A SceneryStack port of the PhET Electric Field of Dreams simulation. Place
charged particles in a box and observe Coulomb interactions and an adjustable uniform external field.
Features
- Add and remove positive or negative particles with selectable mass
- Drag particles to reposition them; physics pauses while dragging
- Uniform external field with draggable direction and magnitude
- Adjustable field-density slider for the arrow grid visualization
- Play / pause / step and Reset All controls
- English and French UI, projector color profile, and PWA support
Quick Start
npm install
npm run icons # generate PNG icons from public/icons/icon.svg
npm start # dev server → http://localhost:5173
Scripts
| Command |
Description |
npm start / npm run dev |
Start Vite dev server |
npm run build |
Type-check + production build → dist/ |
npm run preview |
Preview the production build locally |
npm test |
Run Vitest unit tests (includes memory-leak suite) |
npm run test:fuzz |
Optional Playwright fuzz smoke: pointer (?fuzz) + keyboard (?fuzzBoard), with ?ea, 30s each |
npm run test:fuzz -- 90 |
Same fuzz for 90 seconds (--duration 90 or FUZZ_DURATION=90 also work) |
npm run test:fuzz:quick |
Shorter fuzz smoke (10s) |
npm run test:fuzz:long |
Longer fuzz smoke (300s) |
npm run check |
TypeScript type check |
npm run lint |
Biome lint check |
npm run check:unused / npm run knip |
Report unused files, exports, and dependencies (manual check) |
npm run check:architecture |
dependency-cruiser layer and cycle rules on src/ (manual check) |
npm run format |
Auto-format all files |
npm run fix |
Lint + auto-fix |
npm run icons |
Regenerate PNG icons from public/icons/icon.svg |
npm run release |
check && lint && build && test, then version patch + push tags |
npm run clean |
Remove dist/ |
Tech Stack
License
GNU Affero General Public License v3.0 — see OpenLyceum org license. The original PhET simulation is Copyright © University of Colorado; this is an independent reimplementation.
Contributing
See OpenLyceum contributing guidelines.
Report bugs via GitHub Issues; use org issue templates.
评论