🌍 Public
Viewing a saved revision (read-only)
d3348d1069cb4bb99f268ef3fb14e8d8
Bowl of fruits.js
Bowl of fruits.js demonstrates the D3 data-join pattern with enter, update, and exit selections. Five circles, initially apples, are rendered in SVG; a timer pops one fruit, another timer changes a fruit’s type to lemon, and a final filter removes an element. The example uses `selection.merge` to manage updates and `selection.exit` for removals, with `d3.scaleOrdinal` mapping types to fill colors and radii. It shows how array mutations trigger re-renders of the same chart.
AI-generated description