Skip to main content
100%

Bowl of Fruit-interaction

✓ Published1🌍 Public
SSagar Malviya
Last edited Jun 2, 2019
Created on Jun 2, 2019

A small set of fruit circles sits in a bowl, highlighting an active fruit with a black stroke when clicked. The code uses d3 data joins to update the scene, removing a fruit, replacing one apple with a lemon, and re-rendering at timed intervals. The fruitBowl function applies d3 scaleOrdinal for color and radius, and SVG groups translate each circle and label into position. Click events trigger a state update that re-renders with the new selection highlighted.

AI-generated description
MIT Licensed

Similar vizzes