Mouse Follower
✓ Published0🌍 Public
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 descriptionA circle that follows the mouse using unidirectional data flow.
MIT Licensed