Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
BBenoit Mouly
Last edited Jul 27, 2022
Created on Jul 27, 2022

A single circle tracks the mouse cursor across an SVG canvas, moving to follow the pointer’s exact coordinates. The example uses React state management with `useState` and `useCallback` to update the circle’s `cx` and `cy` attributes on every `mousemove` event. It renders with D3’s `arc` import unused, relying instead on a plain SVG circle. The visualization demonstrates basic interaction and state-driven DOM updates within a React component.

AI-generated description

A program that follows youe mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed