Skip to main content
100%

Loading data with React & D3

✓ Published0🌍 Public
Mmohamedabbessi
Last edited Sep 29, 2023
Created on Sep 29, 2023
Forked from Mouse Follower

A React component renders a D3-selected SVG circle that follows the mouse pointer across the viewport. The example demonstrates unidirectional data flow: mouse events call `setState` to update coordinates, which triggers a re-render passing new state to a `viz` function. It uses `d3.select`, `.join('circle')`, and `.attr` to bind the circle’s position to state properties `x` and `y`. The initial state centers the circle, and the SVG resizes to the window dimensions.

AI-generated description

A circle that follows the mouse using unidirectional data flow. See also Mouse Follower with React.

MIT Licensed

Similar vizzes