Skip to main content
100%

Circles with for loop

✓ Published1🌍 Public
NNita
Last edited Oct 25, 2018
Created on Sep 21, 2018
Forked from Cars report

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 description
MIT Licensed

Similar vizzes