lines with D3 and React
✓ Published0🌍 Public
This example displays a scatterplot of colored circles grouped into five labeled clusters (A–E), connected by colored lines. Clicking a line selects its group, and pressing the left or right arrow keys shifts every point in that group horizontally by 10 units, demonstrating a stateful React interaction driven by keyboard input. The visualization uses React 19 with a `useState`-managed data array, redrawn via `d3.select` and custom `viz.js` logic that builds SVG paths, circles, and axes, while `d3.scaleLinear` maps the 0–1000 x and 0–500 y coordinates.
AI-generated descriptionMovable Lines Visualization
This visualization allows you to move connected lines by clicking on them and using the left/right arrow keys.
How to Use
- Click on any line group (labeled A, B, C, D, or E)
- Press the left arrow key to move the selected group left
- Press the right arrow key to move the selected group right
- Each key press moves the group by 10 units
The selected group will be the one that responds to keyboard input.
MIT Licensed