Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Bowl Of Fruits-Nested

Public visualization

Fork of Bowl Of Fruits-Nested

0 stars1🌍 Public
MMahaveer Jain
Last edited Aug 29, 2021
Created on Aug 28, 2021
Forked from Bowl Of Fruits

This example demonstrates a dynamic fruit bowl visualization where apples are eaten and transformed into lemons through a sequence of timed updates, showing how D3.js handles incremental data changes. The code uses `d3.select` and `selection.merge` to manage SVG groups and shapes, with `transition().duration()` animating circle radii when fruits change. A custom `fruitBowl` function applies ordinal color and radius scales, mapping fruit types to visual properties, while the removal and addition of data elements triggers enter, update, and exit states. The underlying data is a hardcoded array of fruit objects modified by setTimeout callbacks.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed