Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Follow Mouse

Public visualization

Follow Mouse

0 stars1🌍 Public
CCarlos Caballero
Last edited Mar 1, 2021
Created on Mar 1, 2021
Forked from React

A circle follows the mouse cursor across an SVG canvas, centered on the pointer's current position. The visualization uses React's `useState` and `useCallback` hooks to track mouse coordinates from the `onMouseMove` event, updating the circle's `cx` and `cy` attributes accordingly. Rendered with React and D3 v6 in an SVG element, the example demonstrates simple interactive state management without any data source or external datasets.

AI-generated description

Follow mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed