Skip to main content
100%

Bowl of Fruit - Click to Select

✓ Published1🌍 Public
JJordan Chiu
Last edited Jan 27, 2020
Created on Jan 27, 2020

Five pieces of fruit sit in an animated bowl, rendered as circles whose radius and fill come from d3.scaleOrdinal based on fruit type. Clicking an apple or lemon triggers an onClick handler that sets the selected fruit, which receives a thick black stroke via a data join and transition. The example also demonstrates enter, update, and exit selections by removing apples and changing one apple to a lemon at timed intervals, all using d3.transition for smooth radius and position animations.

AI-generated description

Tutorial!

MIT Licensed

Similar vizzes