Skip to main content
100%

Fork of Mouse Follower

✓ Published0🌍 Public
AAsad Zaman
Last edited May 22, 2022
Created on May 22, 2022
Forked from Mouse Follower

This example shows a circle that follows the mouse cursor across an SVG canvas. The visualization uses React with the `useState` and `useCallback` hooks to track mouse coordinates and re-render the circle's position on every `mousemove` event. The circle is rendered as an SVG element with its `cx` and `cy` attributes bound to the current mouse position, while `clientX` and `clientY` from the event provide the updated coordinates. ReactDOM manages the component mounting, and the canvas is fixed at 960 by 500 pixels.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes