Loading data with React & D3
A React component renders a D3-selected SVG circle that follows the mouse pointer across the viewport. The example demonstrates unidirectional data flow: mouse events call `setState` to update coordinates, which triggers a re-render passing new state to a `viz` function. It uses `d3.select`, `.join('circle')`, and `.attr` to bind the circle’s position to state properties `x` and `y`. The initial state centers the circle, and the SVG resizes to the window dimensions.