Skip to main content
100%

Follow Mouse

✓ Published1🌍 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

MIT Licensed

Similar vizzes