Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
Ddaneslutzky
Last edited Mar 25, 2021
Created on Mar 25, 2021

A single black circle tracks the mouse across an SVG canvas, smoothly following the cursor’s exact screen coordinates in real time. The React component uses the `useState` hook to store the mouse position and a `useCallback` handler for `onMouseMove` events, updating the circle’s `cx` and `cy` attributes. Rendering is handled by ReactDOM, with D3’s `arc` import available but unused. The minimal interaction demonstrates how React state and SVG event binding can create responsive pointer-driven visuals.

AI-generated description

A program that follows your mouse.

Comments

Sign in to join the discussion.

MIT Licensed