Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

e52bfb8ac2674922950c26d517447a12

Mouse Follower

0 stars1🌍 Public
TTRANDONGXYZ
Last edited Jan 14, 2022
Created on Jan 14, 2022

A single gray circle tracks the mouse’s exact position across an SVG canvas, updating its center coordinates in real time as the pointer moves. Built with React’s `useState` and `useCallback` hooks, the circle’s `cx` and `cy` attributes are re-rendered on every `mousemove` event, using the `clientX` and `clientY` values from the event object. D3 is loaded but only for its `arc` import, which remains unused in the visible code. The SVG viewport is fixed at 960 by 500 pixels.

AI-generated description

A program that follows your mouse with a circle.