Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

169369c4800b4372abc69fbad0a42065

Mouse Follower

0 stars0🌍 Public
GGenpinZ
Last edited Mar 18, 2022
Created on Mar 18, 2022
Forked from Mouse Follower

This example uses React to render an SVG circle that follows the mouse cursor across the screen. The `index.js` file initializes a React state hook with the circle’s coordinates, then updates that state on every `onMouseMove` event triggered on the SVG element. The circle’s position is bound directly to the current mouse coordinates via the `cx` and `cy` attributes, with a fixed radius of 30 pixels. The visualization relies on React’s `useState` and `useCallback` hooks, along with `ReactDOM.render` to mount the component.

AI-generated description

A program that follows your mouse with a circle.