Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Mouse Follower

Public visualization

Fork of Mouse Follower

0 stars0🌍 Public
SSteven Pearce
Last edited Dec 15, 2021
Created on Dec 15, 2021
Forked from Mouse Follower

A gray circle follows the mouse cursor across a blank SVG canvas, updating its position with every pointer movement. The React component tracks the cursor’s clientX and clientY coordinates via the onMouseMove event, storing them in state and re-rendering the circle’s cx and cy attributes. The visualization uses React 16.9’s useState and useCallback hooks inside a functional component, rendering the shape through ReactDOM into an SVG element sized 960 by 500 pixels.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed