Skip to main content
Public

Share visualization

Loading preview…

Bowl of Fruit -General update pattern

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Bowl of Fruit -General update pattern

1
SSamuel Elbaz
Last edited Dec 11, 2019
Created on Nov 25, 2019

Five circles representing apples shrink and disappear from an SVG bowl as a timer updates the underlying data array. The example demonstrates d3's general update pattern with data joins, entering, updating, and exiting selections. Using `scaleOrdinal` for color and radius mapping, the code renders each fruit as a circle with a text label. The visualization cycles through removing an apple, changing an apple to a lemon, and filtering a fruit, showing how the DOM responds to changes in the `fruits` data.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed