Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
Sstellnew
Last edited Aug 8, 2020
Created on Aug 8, 2020

A circle follows the mouse cursor across an SVG canvas. The example demonstrates React state management with D3.js in the background, using React `useState` and `useCallback` to track cursor coordinates via the `onMouseMove` event. The circle’s position updates in real time through React’s re-rendering, with its `cx` and `cy` attributes bound to the current mouse position. It renders a single circle with a radius of 30 pixels on a 960 by 500 viewport.

AI-generated description

a program that follows your mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed