Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

9d63b9c5b74f420ba893f766800bb58f

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.