🌍 Public
Viewing a saved revision (read-only)
7e0fb1897fff440f9612f53c463d7771
D3 Data Loading...
This example creates a single red circle within an SVG canvas that dynamically tracks the mouse position, using mousemove events to update its center coordinates. Clicking anywhere on the canvas triggers a random RGB color change, altering the circle’s fill. The visualization utilizes d3.select and the join method to efficiently create and update the SVG and circle elements, while managing a state object that stores the current x, y coordinates and color. The viewport dimensions are set to match the browser window size.
AI-generated description