ععباس فاضل
Last edited Nov 16, 2026
Created on Nov 16, 2026
This interactive scatterplot displays five circular marks at positions loaded from a CSV file, with each circle responding to user clicks by toggling between a black fill and a white fill with a black stroke. The React app tracks the selected circle’s ID in state, while D3’s `scaleLinear` maps the fixed data domain to the container’s responsive dimensions, measured via `ResizeObserver`. The visualization re-renders through D3’s `selectAll().data().join()` pattern whenever the selection or container size changes.
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.
Comments
Sign in to join the discussion.