Skip to main content
100%

mouse follower

✓ Published0🌍 Public
Ggragors123@gmail.com
Last edited Jan 9, 2022
Created on Jan 8, 2022

A circle follows the mouse cursor across a full-screen SVG canvas. The example demonstrates state tracking in React: the `useState` hook holds the cursor’s x and y coordinates, while `useCallback` updates that state on every `onMouseMove` event. The circle’s `cx` and `cy` attributes are bound directly to the stored position, so it re-renders instantly. D3 is not used for drawing or data loading here; the interaction relies entirely on React and native SVG elements, with no external data source.

AI-generated description

Mouse follower with a circle, use react to track state, use d3 to load data.

MIT Licensed

Similar vizzes