Skip to main content
100%

pointer moving

✓ Published1🌍 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

MIT Licensed

Similar vizzes