Fork of Mouse Follower
✓ Published1🌍 Public
A circle follows the mouse cursor across a full-screen SVG canvas, updating its position through a unidirectional state flow. The `viz.js` module listens for `mousemove` events on the SVG and calls `setState` to store the cursor’s x and y coordinates, which are then passed back as props to re-render the circle’s `cx` and `cy` attributes. Using D3 v7’s `select` and data joins, the code binds a single circle element to the state, demonstrating a simple reactive pattern where the view is a pure function of the current state.
AI-generated descriptionA circle that follows the mouse using unidirectional data flow.
MIT Licensed