Skip to main content
Public

Share visualization

Loading preview…

19. D3 Drawing SVGs Circles

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

19. D3 Drawing SVGs Circles

0 stars1Public
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

Comments

Sign in to join the discussion.

MIT Licensed