Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
AALI Akbar SABZI
Last edited May 6, 2021
Created on May 6, 2021
Forked from Hello VizHub

A black circle follows the mouse pointer across a blank SVG canvas. The example demonstrates interactive state management in React, where mouse coordinates update the circle’s position in real time. It uses React’s `useState` and `useCallback` hooks to track and handle mouse movement events, while d3.v5 provides the SVG rendering utilities. The circle’s center is set directly from the `clientX` and `clientY` properties of the browser’s mouse event, with no additional data or animation logic.

AI-generated description

A program that follow your mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed