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
KKaleb LaBarrie
Last edited Sep 10, 2021
Created on Sep 10, 2021

D3.js demonstrates the General Update pattern with a bowl of fruit where apples and lemons enter, exit, and change type. Using `d3.scaleOrdinal` for color and radius, circles transition smoothly over one second via `transition().duration()`, with enter selections growing from radius zero and exit selections shrinking away. The example shows both the enter-merge-exit structure with keyed data joins and dynamic updates triggered by `setTimeout`.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

Comments

Sign in to join the discussion.

MIT Licensed