Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading data with React & D3

Public visualization

Loading data with React & D3

0 stars0🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed