Skip to main content
100%

Bowl of Fruit - General Update Pattern2, animated transition

✓ Published1🌍 Public
Jjblaskovich
Last edited May 7, 2020
Created on May 7, 2020

Five pieces of fruit sit in a bowl as colored circles, rendered with SVG and animated by D3 transitions. The example demonstrates the General Update Pattern by adding, removing, and modifying elements over time. Apples appear in red, lemons in yellow, with radius differences encoded via a d3.scaleOrdinal color scale and a separate radius scale. Using the d3 selection API with `.enter()`, `.merge()`, and `.exit()`, the code applies 1000ms transitions to animate radius changes, and `.remove()` deletes exiting circles. The React-framework wrapper calls the `fruitBowl` function on each state change.

AI-generated description
MIT Licensed

Similar vizzes