Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

e5312a972df849c7b9fdd46ebc07ebc1

Mouse Follower

0 stars0🌍 Public
Wwindwaver
Last edited Mar 19, 2021
Created on Mar 18, 2021

The example displays a single gray circle that tracks the mouse cursor across an SVG canvas. Mouse movement triggers a React state update, repositioning the circle’s center coordinates. The code uses React’s `useState` and `useCallback` hooks within an SVG `onMouseMove` handler, while D3 v5 is loaded but unused. Rendering is handled by ReactDOM, with a fixed viewport of 960 by 500 pixels and a circle radius of 30.

AI-generated description

A programm that follows you mouse with a circle.