Skip to main content
100%

Let's make a face with D3.js

✓ Published1🌍 Public
GGeolffrey S Mena
Last edited Dec 21, 2019
Created on Dec 21, 2019

A data-driven update pattern renders a bowl of fruit as colored circles, transitioning from six red apples to a lemon over time. Using D3.js v5, the example demonstrates data joins with `selection.data`, `enter`, `merge`, and `exit` methods within a custom `fruitBowl` function. A `scaleOrdinal` maps fruit types to fill colors and radii, while `setTimeout` triggers sequential state changes—removing one apple and mutating another to a lemon—to show how the visualization reacts to data updates. The SVG is selected and populated from a static `index.html` file.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes