Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
AAlexalim28
Last edited Jul 29, 2021
Created on Jul 29, 2021

A yellow circle follows the mouse cursor across a blank SVG canvas, tracking every movement in real time. The visualization demonstrates React state management, where mouse coordinates update the circle's position via the `useState` and `useCallback` hooks. Rendered as an SVG element, the circle's `cx` and `cy` attributes are bound to the current cursor position. The example uses React 16.9 and D3 v5, with the D3 `arc` function imported but unused, relying instead on React's event handling for interactivity.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed