Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
CCheng Tang
Last edited Oct 22, 2022
Created on Oct 22, 2022

A small circle tracks the mouse in real time across a full-window SVG canvas. The React component stores the pointer’s coordinates in state via `useState` and updates them on every `mousemove` event through `useCallback`. The circle’s `cx` and `cy` attributes are bound directly to the current mouse position, re-rendering on each movement. The example uses React 16.9 with `ReactDOM.render`, an SVG with inline event handling, and no external data source or animation library.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed