Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

8ae6e4ccb3b545c49ca14795a6f7504d

Mouse Follower

0 stars0🌍 Public
TTetiana Humeniuk
Last edited Dec 31, 2022
Created on Dec 31, 2022

A circle follows the user's mouse cursor across a full-window SVG canvas, updating its position in real time. The visualization demonstrates React state management with the `useState` and `useCallback` hooks, where a `mousemove` event handler on the SVG element captures client coordinates. ReactDOM renders the circle at the stored mouse position, with the window dimensions defining the SVG's width and height. The code uses React 16.9 and renders purely with SVG elements, with no external data source.

AI-generated description

A prpgram that follows your mouse with a circle.