🌍 Public
Viewing a saved revision (read-only)
2fbba831b8c84114a695745c83190a04
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