Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading data in react with d3

Public visualization

Viewing a saved revision (read-only)

c2b084b9116741788b69cbbb6ff88cc8

Loading data in react with d3

0 stars0🌍 Public
SSushan Prajapati
Last edited May 21, 2021
Created on May 21, 2021
Forked from Hello VizHub

This example demonstrates a simple interactive visualization where a single circle follows the mouse cursor within an SVG canvas. It shows how to combine React’s state management with D3.js for rendering. The code defines a React component using `useState` to track mouse coordinates, and handles `onMouseMove` events to update the circle’s `cx` and `cy` attributes. It uses `d3.v6` for SVG handling and `ReactDOM.render` to mount the component, with the circle radius hard-coded as 30 pixels.

AI-generated description

React Starter code.