Skip to main content
100%

19. D3 Drawing SVGs Circles

✓ Published1🌍 Public
Aamakanju@nyit.edu
Last edited Feb 12, 2026
Created on Feb 9, 2026

Five SVG circles are drawn horizontally across a browser canvas, their radii determined by a small inline dataset of five numbers. A D3.js v4.5.0 script selects the body element, appends an SVG of width 500 and height 50, then uses chained selection methods—`selectAll`, `data`, and `enter`—to create each circle. The `cx` attribute is computed from each element’s index, while `cy` centers it vertically and `r` maps directly to the data value, producing an animated-free, static rendering.

AI-generated description
MIT Licensed

Similar vizzes