Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Interaction With Unidirectional Data Flow - Mouse Hover

Public visualization

Interaction With Unidirectional Data Flow - Mouse Hover

0 stars0🌍 Public
Ccarlos157oliveira
Last edited Aug 9, 2019
Created on Aug 9, 2019

Five circles representing fruit are rendered as SVG elements inside a 960-by-500 canvas, with each circle’s radius and color determined by its type (orange or lemon) using D3’s `scaleOrdinal`. The visualization demonstrates unidirectional data flow: hovering a circle triggers a `mouseover` event that calls `setSelectedId` to update a selected-id state, which then re-renders the chart, adding a blue stroke to the hovered circle. A `d3.range` generates initial orange fruits, while a lemon is appended, and timed mutations remove fruits and change a type, all handled through D3’s `transition` API for animated updates.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed