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

1 star3🌍 Public
HHe Jianfeng
Last edited Apr 8, 2021
Created on Apr 8, 2021

This example demonstrates the general update pattern in D3.js, showing how a set of circles is incrementally modified in response to changing data. It begins with five apples and then over time removes an apple, changes the third fruit into a lemon, and removes another apple. The code uses the `d3.select`, `d3.range`, and `scaleOrdinal` APIs to set up color and radius scales, while `selection.transition().duration(1000)` animates the `cx` and `r` attributes for entering, updating, and exiting circles. The visualization is rendered as SVG with D3 v6.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed