Skip to main content
100%

Mouse Follower that Changes Color

✓ Published1🌍 Public
CCurran Kelleher
Last edited Jan 16, 2023
Created on Jan 16, 2023
Forked from Mouse Follower

A D3.js v7 circle of radius 50 follows the mouse cursor, changing its fill color to a random RGB value each time the user clicks. The visualization demonstrates unidirectional data flow from mouse events through a state object that stores the current x, y, and color coordinates. Built with D3's `select` and `join` APIs, it renders an SVG inside the `#app` container, updating the circle's `cx`, `cy`, and `fill` attributes on every state change.

AI-generated description

A circle that follows the mouse using unidirectional data flow.

MIT Licensed

Similar vizzes