Viewing a saved revision (read-only)
PBrhwH4ybjK91lB7tbXjD
CCurran Kelleher
Last edited Nov 7, 2026
Created on Nov 7, 2026
This starter example demonstrates a minimal interactive scatterplot built with React and D3, rendering five circles from a local CSV file. Each circle responds to clicks by toggling its fill and stroke to highlight the selected data point. The code uses `useContainerDimensions` with a ResizeObserver to track the container size, then passes that width and height to D3’s `scaleLinear` for positioning. A React state hook (`selectedCircleId`) drives the visual update through a D3 selection with `join`.
AI-generated descriptionReact D3 Starter
A minimal React + D3 starter for building interactive data visualizations.
Files
index.html— page shell and import map (React + D3 from a CDN).index.jsx— mounts the<App />component.App.jsx— loadsdata.csvand renders the visualization.viz.js— D3 render entry point.renderCircles.js— draws the circles.useContainerDimensions.js— tracks the container size.data.csv— sample data.styles.css— page styles.
Getting started
Edit App.jsx to change what gets rendered; the preview updates live as you type.