Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of fruit - click to select

Public visualization

Viewing a saved revision (read-only)

b4a6ff4503b44119b6b949568c7a10de

Bowl of fruit - click to select

0 stars3🌍 Public
TTimothy sit
Last edited Dec 30, 2020
Created on Dec 28, 2020

A bowl of fruit demonstrates a join-based update pattern in D3 v5. Circles represent apples and lemons, scaled by fruit type via `scaleOrdinal`, with the selected fruit highlighted by a black stroke. Clicking a circle triggers a callback that updates the selection and re-renders the visualization. Transitions animate new circles growing from radius zero, exiting circles shrinking away, and position changes over one second. The example uses `selection.data`, `.enter()`, `.merge()`, and `.exit()` to manage enter, update, and exit states, with SVG rendering and an animation showing data changes over time.

AI-generated description