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
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.

Comments

Sign in to join the discussion.

MIT Licensed