Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

7f0127f85bbc46748e0e971aa002fedd

Mouse Follower

0 stars1🌍 Public
Aallan-maker
Last edited Apr 4, 2021
Created on Apr 4, 2021

A yellow-outlined circle follows the mouse pointer across a blank grayscale SVG canvas. The React app tracks pointer movement via an SVG `onMouseMove` handler, updating React state with the cursor's client coordinates. This state drives the circle's `cx` and `cy` attributes, re-rendering the circle's position on every move. The example uses React `useState` and `useCallback` hooks within a functional component, rendered through `ReactDOM.render`.

AI-generated description

A program that follows your mouse with a circle.