🌍 Public
Viewing a saved revision (read-only)
d89cb9b7d14b4058bc3ef712f9c544ce
Fruit bowl
Five red circles are drawn inside an SVG to represent apples, with each apple positioned at an equal horizontal interval and vertically centered. The example demonstrates how D3.js manipulates the DOM by appending circles for an initial dataset and then removing the last apple when the data array shrinks. Using D3 v5’s `select`, `range`, and data join methods like `enter()` and `exit()`, the code explicitly separates data from graphical marks, showing how updates to the underlying array trigger corresponding visual changes.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.