🌍 Public
Viewing a saved revision (read-only)
9dda757954b54006a5575b506a0f156a
D3.js - selectAll(), select(), insert(), and attr()
This example demonstrates how D3.js can directly manipulate SVG elements within an HTML document. Using the D3 v7 library, the code selects all circle elements via `d3.selectAll()` and modifies their fill color and radius attributes based on their index. It then uses `d3.select('body')` followed by `insert()` to add a heading element before the SVG. The example relies entirely on D3's DOM manipulation methods—`selectAll`, `select`, `insert`, and `attr`—to modify an inline SVG containing three black circles.
AI-generated description