Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower That Changes Color

Public visualization

Mouse Follower That Changes Color

0 stars1🌍 Public
Jjjlaber
Last edited Jan 19, 2023
Created on Jan 19, 2023
Forked from Mouse Follower

A circle follows the mouse cursor across a full-screen SVG canvas, changing its fill color to a random RGB value on each click. The visualization demonstrates unidirectional data flow with a state object managed by `setState`, while D3 v7 selections and the `join` pattern handle SVG rendering. Mouse position events trigger state updates through `svg.on('mousemove')`, and color changes use `svg.on('click')` with random `rgb()` generation. The example uses d3.select and d3's data join to bind single elements.

AI-generated description

A circle that follows the mouse using unidirectional data flow.

Comments

Sign in to join the discussion.

MIT Licensed