Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - Nested Transitioned Update Pattern

Public visualization

Bowl of Fruit - Nested Transitioned Update Pattern

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed