Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl Of Fruits-ClickToSelect

Public visualization

Viewing a saved revision (read-only)

c5c57035dcb74771b218b4c44b42df60

Bowl Of Fruits-ClickToSelect

0 stars1🌍 Public
MMahaveer Jain
Last edited Aug 29, 2021
Created on Aug 29, 2021

A bowl of fruit demonstrates click-to-select interaction and dynamic data updates using D3.js. Circles represent apples and lemons, with a black stroke highlighting the selected fruit. The visualization animates transitions when fruits are removed or change type, using D3's `scaleOrdinal` for colors and radii, and `selection.transition()` for smooth updates. The code employs `selectAll`, `data`, `enter`, `merge`, and `exit` patterns to manage DOM elements, with click handlers triggering re-renders via an `onClick` callback.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.