Skip to main content
100%

Moving Mouse

✓ Published2🌍 Public
SSubhendu Karmakar
Last edited Jan 19, 2024
Created on Jan 19, 2024

A single red circle follows the mouse cursor across a full-screen SVG canvas, updating its position in real time with each mousemove event. Clicking anywhere randomly changes the circle's fill color by generating new RGB values. The visualization uses D3 v7's `select`, `join`, and event handling to bind the circle to the pointer coordinates, with state managed through a custom `setState` function that triggers re-renders. The SVG dimensions are set to match `window.innerWidth` and `window.innerHeight`, and the cursor is hidden via CSS.

AI-generated description

Mouse Follower !!!

MIT Licensed

Similar vizzes