Skip to main content
100%

Bowl of Fruit - Click to Select

✓ Published0🌍 Public
JJuyeonee
Last edited Aug 10, 2021
Created on Aug 10, 2021

Five fruit circles appear in a row, rendered as SVG elements colored by fruit type via a `scaleOrdinal` color scale, with apples in red and lemons in yellow. Clicking a circle logs its ID, while pre-scripted `setTimeout` calls dynamically remove circles, change an apple to a lemon, and filter the data array, triggering animated `transition` updates that shrink exiting circles to radius zero. The example uses D3 v7's data join pattern with `selection.enter`, `merge`, and `exit` to sync the visualization with changing data, initializing new circles at radius zero before animating them to their target sizes.

AI-generated description
MIT Licensed

Similar vizzes