Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

1b9af24d378b4878898462573b5f7a9f

Mouse Follower

0 stars1🌍 Public
Sspace-captain96
Last edited Jun 21, 2022
Created on Jun 20, 2022

A circle follows the mouse cursor across a large SVG canvas, updating its position in real time based on pointer movement. The example uses React state and the `useState` and `useCallback` hooks to track the mouse coordinates, passing them to the SVG circle’s `cx` and `cy` attributes. Rendering is handled via ReactDOM, with the SVG element listening for `onMouseMove` events to trigger position updates.

AI-generated description

A program that follows mouse with a circle