Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern - singular elements

Public visualization

Viewing a saved revision (read-only)

b5c74e5f1e294822b77d35f328a05a35

Bowl of Fruit - General Update Pattern - singular elements

0 stars1🌍 Public
Jjblaskovich
Last edited May 7, 2020
Created on May 7, 2020

A bowl of fruit demonstrates the general update pattern for singular elements using d3 data joins. Apples and lemons are rendered as colored circles with labels, using ordinal scales for color and radius. The example shows enter, update, and exit selections through timed state changes: an apple is removed, a fruit changes type from apple to lemon, and another apple is filtered from the array. The code uses d3-selection's `.data()`, `.enter()`, `.merge()`, and `.exit()` methods to manage SVG groups and their circle and text children.

AI-generated description