Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
AAngel Lam
Last edited Mar 12, 2021
Created on Mar 8, 2021

A circle tracks the mouse's position across an SVG canvas, updating its center coordinates in real time. The React component uses the `useState` hook to store the current mouse position and `useCallback` to handle `onMouseMove` events. D3's `arc` API is imported but not used, while the circle's movement relies purely on React state updates triggered by the `clientX` and `clientY` values from the event object. The visualization demonstrates a simple interactive pattern with SVG rendering within a React application.

AI-generated description

Mouse Follower

Comments

Sign in to join the discussion.

MIT Licensed