Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
AAnthony Ynami
Last edited Feb 18, 2021
Created on Feb 18, 2021
Forked from SVG face w/ React

An interactive SVG circle follows the mouse cursor across a 960x500 canvas. The React application tracks pointer movement via the `onMouseMove` event handler, updating the circle's center coordinates with each `clientX` and `clientY` value. Using `useState` for position state and `useCallback` to optimize the event handler, the code renders a single red circle (radius 30) whose position updates in real time. The example demonstrates a basic React-D3 integration, with the visualization rendered entirely through React's declarative SVG output.

AI-generated description

a program that follows your mouse with a circle

MIT Licensed

Similar vizzes