Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

186b717f094645b3aaa85e3bd1eb790c

Mouse Follower

0 stars2🌍 Public
Iiffath.namira@csedge.org
Last edited Jan 9, 2025
Created on Jan 9, 2025

A black circle follows the mouse cursor across an SVG canvas, updating its position in real time with each mouse movement. The visualization uses React's `useState` and `useCallback` hooks to manage the circle's coordinates, while ReactDOM renders the SVG element. Mouse events are captured through the SVG's `onMouseMove` handler, which updates the circle's `cx` and `cy` attributes. The code imports React, ReactDOM, and D3 v5, though D3 is not utilized in the interaction logic itself.

AI-generated description

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

See also React Starter.