Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

0f57352cf635469ea27451746233339f

Mouse Follower

0 stars0🌍 Public
SSong Tao Chen
Last edited Dec 27, 2021
Created on Dec 26, 2021

A React component renders an SVG circle that follows the mouse pointer across a 960 by 500 viewport. The circle’s center coordinates are updated via React’s `useState` hook and a `handleMouseMove` callback attached to the SVG’s `onMouseMove` event. The `useCallback` hook memoizes the event handler, and `ReactDOM.render` mounts the app. The visualization demonstrates basic state-driven interactivity without external data, using only React and SVG primitives.

AI-generated description