Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

pointer moving

Public visualization

Viewing a saved revision (read-only)

b112968564e44c05822e56f2cf3ed65e

pointer moving

0 stars1🌍 Public
Mmarouan-ben
Last edited Sep 11, 2023
Created on Sep 11, 2023

A yellow circle tracks the mouse pointer across an SVG canvas, updating its position in real time as the user moves the cursor. The visualization uses React state management with the `useState` and `useCallback` hooks to capture mouse coordinates via the SVG `onMouseMove` event. The circle’s `cx` and `cy` attributes are bound to the current mouse position, and it is rendered at a fixed radius of 30 pixels. The code initializes the circle at the center of a 960 by 500 viewport. No external data source is involved; the interaction is purely mouse-driven.

AI-generated description

a programm that follows a mouse