Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

649ed1c4fcf24e4f890b20bb1b9c223d

Mouse Follower

0 stars0🌍 Public
Vvmonney
Last edited Sep 25, 2022
Created on Sep 25, 2022

A simple interactive visualization renders a single circle that follows the mouse cursor across an SVG canvas. The circle’s position updates in real time, tracking the user's pointer movement. The example uses React’s `useState` and `useCallback` to manage the mouse coordinates, and renders the circle via an SVG `<circle>` element with `cx` and `cy` attributes set from the current mouse position. The `onMouseMove` event handler on the SVG element captures the cursor's `clientX` and `clientY` values, which are then used to update the circle’s location.

AI-generated description

A program that follows your mouse with a circle.