Skip to main content
100%

Bowl of Fruit: Nested Elements

✓ Published0🌍 Public
IIgor Chernega
Last edited Apr 5, 2020
Created on Apr 5, 2020

Five fruit circles appear in a row, then an animation sequence removes, re-types, and removes fruits to show nested data joins. Using D3 v5, the code binds an array of fruit objects to SVG `<g>` groups, appending circles and text labels inside each. The `fruitBowl` function separates enter and update selections, merging them before applying `transition().duration(1000)` to animate circle radii via a color and radius scale. The `index.js` script schedules state changes with `setTimeout` and re-renders, while `scaleOrdinal` maps fruit types to colors and sizes.

AI-generated description

D3 course follow along.

MIT Licensed

Similar vizzes