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
Ffaithlum
Last edited Mar 29, 2023
Created on Mar 29, 2023
Forked from Mouse Follower

This example demonstrates a simple interactive visualization built with React and D3, where a circle follows the user’s mouse movement within an SVG canvas. The app initializes the circle at the center of a 960 by 500 pixel viewport, then updates its position on every mouse move using React’s `useState` and `useCallback` hooks. The SVG’s `onMouseMove` event handler captures the cursor’s client coordinates and passes them to the circle’s `cx` and `cy` attributes, rendering the result via `ReactDOM.render`. No external data loading is involved; the focus is on state-driven, real-time updates.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed