Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Kkratikashetty1102@gmail.com
Last edited Jan 18, 2023
Created on Jan 17, 2023
Forked from Mouse Follower

A red square tracks the mouse across a full-screen SVG canvas. The visualization demonstrates unidirectional data flow using D3 v7's `select` and `join` pattern. A `mousemove` event on the SVG invokes a `setState` callback, which updates the state object with cursor coordinates and triggers a re-render, repositioning the 25×25-pixel rectangle. The `viz` function binds the state to the square's `x` and `y` attributes.

AI-generated description

A circle that follows the mouse using unidirectional data flow.

MIT Licensed

Similar vizzes