Fork of HTML Starter
✓ Published0🌍 Public
This example demonstrates a circle following the mouse cursor inside an SVG canvas using React’s `useState` hook to track position changes. The visualization updates the circle’s `cx` and `cy` attributes in response to the `onMouseMove` event, rendering with ReactDOM and D3.js v5 as a dependency. The code relies on clientX and clientY coordinates from the event object to reposition the circle dynamically, with the initial state centered at half the SVG’s width and height.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed