🌍 Public
Viewing a saved revision (read-only)
94bb5d9e1f7c4bcfb03700e17b0de9b0
Bowl of fruit general update pattern
A bowl of fruit demonstrates D3's general update pattern with three apple and lemon circles transitioning in size and position over four seconds. The animation shows an apple disappearing, a lemon being swapped in, and a second apple being removed, with all circles smoothly resizing via `transition().duration(1000)`. The code uses D3 v5's `scaleOrdinal` for color and radius mapping, `selectAll('circle').data()` for data binding, and `enter()`, `merge()`, and `exit()` to handle state changes, rendering as SVG with hardcoded fruit objects generated via `range(5).map()`.
AI-generated description