Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Bowl of Fruit - General Update Pattern

Public visualization

Viewing a saved revision (read-only)

bad42e5d95084d7290da749616ca588b

Fork of Bowl of Fruit - General Update Pattern

0 stars1🌍 Public
IIsigned
Last edited Nov 28, 2021
Created on Nov 28, 2021

This example demonstrates the general update pattern in D3 v5, showing how data joins manage enter, update, and exit selections for a simple fruit bowl visualization. Circles represent apples and lemons, with colors and radii mapped via ordinal scales. Using D3 selections and the `merge()` method, the code updates the SVG as fruits are removed, replaced, and filtered over timed intervals. The `fruitBowl.js` module exports a function that binds fruit data to circle elements, while `index.js` drives the state changes with `setTimeout`.

AI-generated description