🌍 Public
Viewing a saved revision (read-only)
00fb644742394a848bd51d8a508c8d71
Bouncing Balls
Bouncing Balls demonstrates a physics simulation of colorful particles colliding and bouncing within a canvas. Clicking adds new balls to the scene. The visualization uses D3’s `forceSimulation` with `forceCollide`, `forceX`, and `forceY` to handle particle interactions, while a custom `timer` loop applies gravity and wall collision logic. Rendering is done via the Canvas 2D API, with trails, velocity lines, and arrowheads colored by speed using HSL values.
AI-generated descriptionReact Starter with D3 Physics Simulation
A React application featuring D3-based physics simulation with bouncing particles, rendered using HTML5 Canvas for optimal performance.
Structure
index.jsx- React entry pointApp.jsx- Main React componentviz.js- Visualization orchestratorphysics.js- Physics simulation logicanimation.js- Animation loop managementrender.js- Canvas rendering logicutils.js- Utility functions for colors and statisticsdata.js- Sample dataconstants.js- Configuration constants