Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
Jjulesgentry
Last edited Jul 29, 2022
Created on Jul 29, 2022

A yellow circle follows the mouse cursor inside an SVG canvas, updating its position in real time to mirror the pointer’s coordinates. The example demonstrates React’s `useState` and `useCallback` hooks to manage the cursor’s x and y values, while the `onMouseMove` event on the SVG element triggers the state update. Rendered using React DOM with D3 v5, the circle’s radius is fixed at 30 pixels, and its center is bound to the tracked mouse position.

AI-generated description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes