Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

f1a52b29c2a7482a9f1333414733f460

Mouse Follower

0 stars0🌍 Public
Qqtrfx
Last edited Jun 17, 2023
Created on Jun 17, 2023

A circle follows the mouse pointer inside a static SVG viewport. The circle updates its position through React state management on mouse movement events. The React `useState` hook stores the mouse coordinates, and the `onMouseMove` handler on the `<svg>` element updates them, causing the circle to re-render at the new location. The example uses ReactDOM to render the SVG, with no data source beyond the cursor’s clientX and clientY values.

AI-generated description

A program that follows your mouse with a circle.