Skip to main content
100%

Fork of Mouse Follower

✓ Published1🌍 Public
Mmanishcheruku
Last edited Mar 10, 2023
Created on Mar 10, 2023
Forked from Mouse Follower

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 description

A circle that follows the mouse using unidirectional data flow.

MIT Licensed

Similar vizzes