Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

MouseFollower

Public visualization

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

Comments

Sign in to join the discussion.

MIT Licensed