Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - Click to select! with D3.js!

Public visualization

Viewing a saved revision (read-only)

397b20b6653e4d1e9b6e686ccfab6296

Bowl of Fruit - Click to select! with D3.js!

0 stars0🌍 Public
Fforcox43
Last edited Jul 15, 2020
Created on Jul 15, 2020

This example shows a bowl of fruit rendered as SVG circles and labels, where apples and lemons are distinguished by color and size. The visualization updates over time as fruits are removed or replaced, demonstrating how D3.js 5 with React-like merge and exit operations handles dynamic data changes. Using `scaleOrdinal` for color and radius mappings, the code appends groups with circles and text, adjusting their positions and attributes as the fruit array mutates.

AI-generated description

Wants to listen for click events.

A bare minimum HTML page.

See also React Starter.