Fork of Circles with D3
✓ Published0🌍 Public
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 descriptionCreating circles with D3
Challenge
- Fork this example
- Modify it
- Be Creative
MIT Licensed