Skip to main content
100%

Bowl of Fruit - Export Module to separate file

✓ Published2🌍 Public
MMinwoo Pak
Last edited Nov 16, 2019
Created on Nov 11, 2019

A modular D3 v5 example renders a changing bowl of fruit as circles in an SVG. It uses `d3.scaleOrdinal` for color and radius mapping, and `d3.select` with a `data` join to manage enter, update, and exit selections. The `fruitBowl` function is exported from a separate file and imported into `index.js`, which drives the animation with `setTimeout` calls to remove apples and change one to a lemon. The data is plain JavaScript objects with a `type` property, and the visualization updates over three seconds.

AI-generated description
MIT Licensed

Similar vizzes