Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

5df7c91c49d041cc87914af42c819643

Mouse Follower

0 stars0🌍 Public
JJoe Hutchins
Last edited Feb 16, 2022
Created on Feb 16, 2022

A single circle follows the mouse cursor across an SVG canvas, responding directly to pointer movement. Built with React, the component tracks the mouse position via the `onMouseMove` event and updates state with `useState` and `useCallback`. The circle’s `cx` and `cy` attributes are bound to the current coordinates, using the `clientX` and `clientY` properties from the event object. The visualization demonstrates real-time interaction, with the circle centered at the initial screen midpoint before any movement occurs.

AI-generated description

A program that follows your mouse with a circle