Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Mouse follower

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed