Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern Special Cases

Public visualization

Bowl of Fruit - General Update Pattern Special Cases

0 stars0🌍 Public
Eerin
Last edited Feb 14, 2020
Created on Feb 14, 2020

This example demonstrates the general update pattern in D3 with special cases for data mutations. A bowl of apples changes over time as fruits are eaten and replaced with lemons, showing how the visualization handles removal, modification, and filtering of data elements. The code uses `d3.select`, `d3.range`, and custom ordinal scales for color and radius, rendering SVG circles and text. The update logic in `fruitBowl` manages enter, update, and exit states through `selection.selectAll`, `.merge`, and `.exit().remove()` operations.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed