Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Viewing a saved revision (read-only)

bcaee02208a34d35bd969f2646688abf

Let's make a face with D3.js!

0 stars1🌍 Public
Eemntd
Last edited Oct 18, 2019
Created on Oct 17, 2019

A bowl of fruit rendered as SVG circles demonstrates data joins with D3.js. The code uses `d3.scaleOrdinal` for color and radius, binding an array of fruit objects to `circle` elements via `selection.data`. After one second, `fruits.pop()` removes the last apple, triggering an exit transition; after two seconds, the third fruit’s type changes to lemon, updating its fill and size. The examples uses `selection.enter`, `merge`, and `exit` patterns to handle updates.

AI-generated description