Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

11891ee9f19c4c7786da71cc5a326ec9

Mouse Follower

0 stars0🌍 Public
TTatyana Milanova
Last edited Oct 4, 2023
Created on Oct 4, 2023
Forked from Hello VizHub

A mouse follower example renders a single SVG circle that tracks the cursor's position within a 960 by 500 viewport. Using React state hooks (`useState` and `useCallback`), the component updates the circle's `cx` and `cy` coordinates on every `mousemove` event. D3 version 7 is loaded for potential utilities, though the interaction relies solely on React's event handling and SVG rendering. The circle starts centered and moves fluidly, demonstrating simple interaction between DOM events and React's declarative UI updates.

AI-generated description

A program that follows your mouse with a circle.