Fork of Fork of Fork of Fork of Fork of React & D3 Starter
✓ Published0🌍 Public
SSanjayRamaSwamyAdla@my.unt.edu
Last edited Mar 30, 2026
Created on Mar 30, 2026
This example shows a reusable scatter plot of study hours versus test scores, with seven data points plotted on a fixed 500×400 SVG canvas. The code uses D3 v7 to create linear scales for both axes, append circles with steelblue fill, and render axis ticks via `d3.axisBottom` and `d3.axisLeft`. It also adds text labels for both axes. The visualization is implemented as a plain JavaScript function called `scatterPlot(container, data)`, which appends the SVG dynamically, while the included React starter demonstrates D3 selection in a `useEffect` hook. The dataset is hardcoded inline.
AI-generated descriptionMIT Licensed