Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

f914d71d25bc4e819fa2f3336a87c889

Mouse Follower

0 stars1🌍 Public
GGonzalo Alarcón Usui
Last edited Dec 2, 2021
Created on Dec 2, 2021

A single yellow circle tracks the mouse position within an SVG viewport of 960 by 500 pixels. The React component uses the `useState` hook to store the mouse coordinates, which are updated on every `mousemove` event via the `handleMouseMove` callback. The circle’s `cx` and `cy` attributes are bound to the current state, causing it to follow the cursor directly without any animation or interpolation. The rendering is handled entirely by React’s declarative SVG elements, with no D3 API calls used.

AI-generated description

A program that follows your mouse with a circle.