Skip to main content
100%

Click to Select: Interaction with Unidirectional Data Flow

✓ Published1🌍 Public
AAnnie Liao
Last edited Jun 22, 2020
Created on Jun 22, 2020

Five fruit circles animate in and out of a bowl, and clicking one selects it with a navy stroke. The example demonstrates unidirectional data flow where React-like state changes trigger a re-render that updates SVG circles via D3’s data join and `transition` for smooth radius and fill changes. It uses `scaleOrdinal` for color and size, `selectAll` with key functions, and `merge`/`exit` for enter-update-exit patterns. The code shows automatic updates as fruits are removed or replaced without direct DOM manipulation.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes