Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

MouseFollower

Public visualization

Viewing a saved revision (read-only)

7ff41b3f4e0f473886ec697b6c007d9d

MouseFollower

0 stars0🌍 Public
GGimmi45
Last edited Jan 24, 2022
Created on Jan 21, 2022

A circle follows the mouse cursor across an SVG canvas, updating its position in real time as the pointer moves. The example uses React state with the `useState` and `useCallback` hooks to track mouse coordinates, which are passed as `cx` and `cy` attributes to a D3 v7-generated circle element. The SVG itself handles mouse movement events via `onMouseMove`, while the ReactDOM library renders the component into the DOM.

AI-generated description

A Programe that follows your mouse with a circle