Skip to main content
100%

Ruler and ants problem

✓ Published0🌍 Public
GGiorgi Eufshi
Last edited Jan 24, 2021
Created on Jan 24, 2021
Forked from D3 Starter

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 description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes