Circles with for loop
✓ Published1🌍 Public
Thirty green circles form a single horizontal row across an SVG canvas, each with a radius of 10 pixels and spaced 40 pixels apart. The example demonstrates programmatic data generation using a JavaScript `for` loop that builds an array of x-coordinates, which is then bound to circle elements via D3 v5’s data join (`svg.selectAll('circle').data(data).enter()`). The SVG width is explicitly set to 900 pixels, while the height is 500 pixels, and each circle’s `cx` attribute is computed from the generated data values.
AI-generated descriptionMIT Licensed