Bowl of Fruit - Click event
✓ Published1🌍 Public
A bowl of five apples is rendered as SVG circles, with click events selecting a fruit and highlighting it with a black stroke. The data-bind updates smoothly through animated transitions: apples shrink and disappear when eaten, and the third apple morphs into a lemon with a color and size change. Using d3-v5, the code employs scaleOrdinal for color and radius mapping, selection.merge for updating, and transition().duration() to animate enter, update, and exit states.
AI-generated descriptionMIT Licensed