🌍 Public
Viewing a saved revision (read-only)
339b8ac520a345829d653554b50169c0
Ruler and ants problem
A line of red and black circles moves across an SVG ruler, bouncing off the edges and each other. The simulation uses D3 v6 with `d3.select` to manage the SVG and `d3.axisBottom` with `d3.scaleLinear` for the ruler. A `setInterval` updates positions every 70 milliseconds; collisions reverse velocities when circles overlap.
AI-generated descriptionA demonstration of how to start using D3 version 6.