Skip to main content
100%

mouse follower

✓ Published1🌍 Public
Nnexus1058
Last edited Jan 21, 2021
Created on Jan 20, 2021

A single black circle on an SVG canvas tracks the user's mouse cursor in real time, creating a simple interactive visual. The example demonstrates state management in React, using the `useState` and `useCallback` hooks to update the circle's `cx` and `cy` attributes on every `mousemove` event. Rendered with SVG elements, the circle is positioned via React's `onMouseMove` handler, while D3 v5 and React 16 are loaded externally. No data source is involved; the visualization purely reacts to pointer movement within the 960 by 500 pixel viewport.

AI-generated description

a program that follows your mouth with a circle.

MIT Licensed

Similar vizzes