Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

334378d9f0a641c9b690e45a86ed564d

Mouse Follower

0 stars0🌍 Public
LLai Yi Ohlsen
Last edited Dec 23, 2023
Created on Dec 23, 2023

A yellow circle follows the mouse cursor across a full-screen SVG canvas, using React state to track and render its position. The app listens for `mousemove` events on the SVG element, extracting `clientX` and `clientY` coordinates via `useCallback` and updating the circle’s `cx` and `cy` attributes through `useState` and `ReactDOM.render`. This demonstrates a simple interactive pattern with React’s declarative rendering and SVG’s coordinate system.

AI-generated description

A program that follows your mouse with a circle.