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

4
SShuyu Zheng
Last edited Jan 24, 2021
Created on Jan 12, 2021

A bowl of fruit demonstrates the general update pattern, showing five apples that enter, change, and exit over time. The visualization uses D3 v6's `scaleOrdinal` for color and radius mappings, with `transition` animations that grow entering circles from zero radius, fade exiting ones back to zero, and smoothly update attributes for persistent items. The code applies the pattern through `selectAll`, `enter`, `merge`, and `exit` methods, driven by `setTimeout` calls that pop, replace, and filter the fruit array.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed