Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars210๐ŸŒ Public
CCurran Kelleher
Last edited May 19, 2020
Created on Aug 29, 2019

A circle follows the mouse cursor within an SVG canvas. The visualization uses React's `useState` and `useCallback` hooks to track the cursor's `clientX` and `clientY` coordinates from the SVG's `onMouseMove` event, updating the circle's `cx` and `cy` attributes in real time. The app renders through ReactDOM, with the circle's radius set to 30 pixels on a 960 by 500 canvas.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed