Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

d8048eaac9024cd7afee955f677b8363

Mouse Follower

0 stars0🌍 Public
RRonanFonseca
Last edited Aug 17, 2022
Created on Aug 17, 2022

A yellow circle follows the mouse cursor as it moves across a blank SVG canvas. The circle’s position is updated on every mouse-move event, using React’s `useState` and a custom `handleMouseMove` callback. The example uses React and ReactDOM to render an SVG `<circle>` element, with the cursor’s `clientX` and `clientY` coordinates directly mapping to the circle’s `cx` and `cy` attributes. The initial circle is centered at 480, 250 with a radius of 30.

AI-generated description

A program that follows your mouse with a circle.