Skip to main content
100%

Mouse Follower with React

✓ Published0🌍 Public
CCurran Kelleher
Last edited Jun 14, 2023
Created on Jun 14, 2023
Forked from React Starter

A circle follows the mouse cursor across the screen, updating its position in real time. The example integrates D3.js selection and event handling within a React component, using React's `useState` and `useLayoutEffect` to manage state and trigger re-renders. The `viz.js` module binds a D3 `mousemove` event to an SVG and updates the circle's `cx` and `cy` attributes based on cursor coordinates. Initial state is set to the center of the window before any mouse movement occurs.

AI-generated description

A variant of Mouse Follower that uses React.

MIT Licensed

Similar vizzes