Skip to main content
100%

Follow mouse with circle.

✓ Published1🌍 Public
IIlia Katkovnik
Last edited Mar 13, 2021
Created on Mar 10, 2021

A circle follows the mouse as it moves across an SVG canvas. The demonstration uses React state to track cursor coordinates on mouse move and updates the circle’s position accordingly. Built with React 17 and D3 v6, the visualization relies on React’s `useState` and `useCallback` hooks, while the SVG circle’s `cx` and `cy` attributes are bound to the current mouse position.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes