Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

0ad1d920956740949f825d9bc91c3e57

Mouse Follower

0 stars1🌍 Public
Iisavedalex
Last edited Jun 7, 2021
Created on Jun 7, 2021

A circle follows the mouse cursor across a blank SVG canvas. The visualization uses React state to track the cursor's coordinates and updates the circle's position on every mouse move event. It renders via SVG, with React's `useState` hook storing the x and y position and `useCallback` handling the move event listener. The circle is drawn with a fixed radius of 30 pixels, and the mouse position is initialized to the center of the 960 by 500 pixel viewport.

AI-generated description

A program that follows your mouse with a circle