Skip to main content
100%

Interaction with React

✓ Published0🌍 Public
EEd Hutchinson
Last edited Apr 16, 2023
Created on Apr 16, 2023

This example shows a single yellow circle that follows the mouse cursor across a 960-by-500 SVG canvas. Built with React 16.9 and D3 v5, the app uses the `useState` and `useCallback` hooks to track the cursor’s `clientX` and `clientY` coordinates, updating the circle’s `cx` and `cy` attributes on every `mousemove` event. The D3 `arc` import is included but unused in the visible code.

AI-generated description

Smiley face implementation with React & D3.

MIT Licensed

Similar vizzes