Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published0🌍 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.

MIT Licensed

Similar vizzes