Skip to main content
Public

Share visualization

Loading preview…

Fork of Circles with D3

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

Fork of Circles with D3

0
XXiaojun
Last edited Sep 9, 2025
Created on Aug 27, 2025
Forked from Circles with D3

This gallery example uses D3.js v7 to render a circular composition of filled circles on an SVG canvas. A large purple circle is positioned at the center, while six smaller circles with vivid colors orbit around it, evenly spaced using basic trigonometric placement with `Math.cos` and `Math.sin`. The layout dynamically adjusts the ring radius based on container dimensions and circle sizes, ensuring the arrangement fits within the viewport. The code uses D3’s data join pattern with `selectAll().data().join()` to bind circle elements, applying position, radius, and color attributes with 70% opacity against a light green background.

AI-generated description

Creating circles with D3

Challenge

  • Fork this example
  • Modify it
  • Be Creative

Comments

Sign in to join the discussion.

MIT Licensed