Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

mouse_follower

Public visualization

Viewing a saved revision (read-only)

e0004d6c6b134452925f87845e1d9ecc

mouse_follower

0 stars1🌍 Public
Iindranil-sri
Last edited Nov 8, 2021
Created on Nov 8, 2021
Forked from Smile part 1

This example demonstrates a yellow circle that follows the mouse cursor as it moves over an SVG canvas. The visualization uses React hooks, specifically `useState` and `useCallback`, to track the cursor’s `clientX` and `clientY` coordinates. An `onMouseMove` event handler updates the circle’s center position in real time. The rendering relies on React’s declarative JSX, with no D3 bindings, and the SVG is sized at 960 by 500 pixels, matching the viewport dimensions.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.