Skip to main content
100%

Bowl of Fruit - Nested Transitioned Update Pattern

✓ Published0🌍 Public
OOleg
Last edited Nov 3, 2020
Created on Oct 30, 2020

Five fruits sit in a bowl, shrinking when removed, changing color from red apples to yellow lemons, and sliding to new positions. This demonstrates D3's nested update pattern with transitions, using `selection.data`, `enter`, `merge`, and `exit` selections. The code explicitly animates `transform` with `.transition().duration(1000)`, shrinks exiting circles to radius 0, and removes groups after 600ms. Data is an array of randomized fruit objects with `type` and `id`, rendered as SVG circles with `scaleOrdinal` color and radius scales.

AI-generated description
MIT Licensed

Similar vizzes