Bowl of fruit click to select
✓ Published1🌍 Public
A bowl of fruit demonstrates interactive selection and data-driven updates with D3.js. Five apples render as circles in an SVG, and clicking any fruit selects it with a black stroke. The code uses `scaleOrdinal` for color and radius mappings, while `selection.enter`, `merge`, and `exit` manage dynamic updates as fruits are removed or change type. Transitions animate position and size changes over one second. A click handler triggers re-rendering to highlight the selected fruit.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.
MIT Licensed