Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
AAlexander Dorling
Last edited May 11, 2021
Created on May 11, 2021

A circle in an SVG chart follows the cursor as it moves across the viewport. React state tracks the mouse position, updated through an `onMouseMove` event handler. The `useState` and `useCallback` hooks manage the coordinate updates, while `ReactDOM.render` mounts the component. The circle’s `cx` and `cy` attributes are bound directly to the tracked `x` and `y` values, creating a real-time interactive visualization with no external data source.

AI-generated description

Mouse follower

MIT Licensed

Similar vizzes