Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Blow of fruit - General update pattern

Public visualization

Viewing a saved revision (read-only)

54f79ead839e4b819c3d6b650f8b9093

Blow of fruit - General update pattern

0 stars1🌍 Public
PPotikorn
Last edited Mar 3, 2020
Created on Feb 17, 2020

A row of apples and lemons animates through the general update pattern in this D3.js example. Buttons and timed re-renders trigger enter, update, and exit selections as fruits are added, replaced, or removed. Using the `selection.join()` method with d3.v5, the code binds fruit data to SVG groups, transitioning circle radii, colors, and text labels between states. The `colorScale` and `radiusScale` ordinal scales map fruit types to visual properties.

AI-generated description

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