Skip to main content
100%

Bowl of fruits

✓ Published0🌍 Public
AAsperge-Atomique
Last edited Sep 20, 2019
Created on Sep 20, 2019

This example shows a dynamic bowl of fruits rendered as circles in an SVG canvas, where apples and lemons appear and disappear over time. Initially five fruits are drawn using a D3 data join with `scaleOrdinal` for both color and radius, mapping fruit types to red or yellow. After one second, a fruit is removed and another changes from an unknown type to a lemon, triggering D3’s enter/exit updates to reflect the state changes. The code uses D3 v5’s `select`, `range`, and `scaleOrdinal` APIs with explicit `setTimeout` calls to drive the transitions.

AI-generated description
MIT Licensed

Similar vizzes