Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower Refactor

Public visualization

Viewing a saved revision (read-only)

a5c1f5db30fc434ab6073e1667b83af2

Mouse Follower Refactor

0 stars0🌍 Public
AAndrewLamWARC
Last edited Oct 22, 2021
Created on Oct 22, 2021
Forked from Mouse Follower

This example demonstrates a circle that tracks the user’s mouse movements across an SVG canvas, updating its position in real time. Using React’s `useState` and `useCallback` hooks, the app captures `clientX` and `clientY` coordinates from the `onMouseMove` event and passes them as `cx` and `cy` attributes to the circle element. The rendering relies on React 16.9 and ReactDOM, with no additional data sources or visualization libraries involved.

AI-generated description

A program that follows your mouse with a circle.