Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

9aac6ac9a91e4a17b8cca9b91a812cf6

Mouse Follower

0 stars1🌍 Public
RRodrigo Zanco
Last edited May 4, 2021
Created on May 4, 2021

A single circle follows the mouse cursor within an SVG canvas. The example demonstrates the basic concept of tracking pointer movement and updating a visual element's position in response. It is built with React hooks, specifically `useState` to manage the circle's coordinates and `useCallback` to handle the `onMouseMove` event, rendering the circle with SVG attributes `cx` and `cy`. The scene is initialized with the circle centered, and no external data source is used.

AI-generated description

Seguir o mouse com um circulo.