Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Viewing a saved revision (read-only)

745ee14c07d4413d93d7b22489ee2664

Mouse follower

0 stars1🌍 Public
TTulioChiodi
Last edited May 13, 2021
Created on May 13, 2021

A yellow circle follows the mouse cursor across an SVG canvas. The circle's position updates in response to mouse movement, starting at the center of the 960 by 500 viewport. The example uses React’s `useState` and `useCallback` hooks to manage the cursor coordinates, with the SVG `onMouseMove` event triggering state updates. The circle is rendered as an SVG `<circle>` element, and the React DOM handles re-rendering on each move.

AI-generated description

A program that follows your mouse with a circle