Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of HTML Starter

Public visualization

Viewing a saved revision (read-only)

d354639ae9744dbcba5b21435a547b5d

Fork of HTML Starter

0 stars0🌍 Public
DDavid Adelekan
Last edited Jun 13, 2021
Created on Jun 13, 2021
Forked from HTML Starter

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 description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.