Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern

Public visualization

Bowl of Fruit - General Update Pattern

0 stars0🌍 Public
IIsabel
Last edited Oct 1, 2018
Created on Oct 1, 2018

A bowl of fruit demonstrates the general update pattern for data joins in D3. Rows of apples transition in and out, with one apple changing into a lemon mid-animation, using d3.selectAll and data joins keyed by id. The code uses d3.scaleOrdinal for fruit color and radius, svg rect, circle, and text elements, and d3.transition with a 1000ms duration to animate updates. The index.js drives timed changes to the fruits array.

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