Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

a5b41fc94f274238b55e10722e8be4d4

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.