Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

12.b - fruit bowl - d3 update pattern, nested elements - dataviz 2018

Public visualization

12.b - fruit bowl - d3 update pattern, nested elements - dataviz 2018

0 stars2🌍 Public
Zzach b.
Last edited Nov 24, 2021
Created on Nov 24, 2021

A fruit bowl visualization demonstrates the D3 update pattern with nested elements, showing apples and lemons as circles in a bowl that changes over timed intervals. The code uses d3.scaleOrdinal for colors and radius mapping, with d3-selection’s enter, merge, and exit methods to handle dynamic data updates. An SVG renders the bowl as a rounded rectangle, while each fruit is a group containing a circle and text label. The example includes a deliberate data mutation where an apple becomes a lemon, illustrating how the update pattern reuses existing DOM nodes efficiently.

AI-generated description

datraviz 2018 #12.a - fruit bowl - d3 update pattern, nested elements

Comments

Sign in to join the discussion.

MIT Licensed