🌍 Public
Viewing a saved revision (read-only)
996bb00fcf544426a27bd0f55e044b79
Test
This example demonstrates data binding in D3 v5, where a simple list of numbers is rendered as SVG text labels. Clicking the SVG triggers an update that doubles each value, showcasing the enter, update, and exit pattern through `d3.select` and the `data()` join. The visualization uses `selectAll("text")` to bind the array to existing elements, appends new text nodes on enter, repositions them with an `attr("x")` callback, and removes extras via `exit().remove()`. The initial data `[1,2,3]` is hard-coded and rendered within an SVG of fixed dimensions.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.