Skip to main content
100%

Scatter plot

✓ Published0🌍 Public
Ggayathrisaxena23@gmail.com
Last edited Mar 30, 2026
Created on Mar 30, 2026
Forked from React & D3 Starter

This example shows a scatter plot of five custom data points relating study hours to test scores, with hours on the x-axis and scores on the y-axis. It draws fixed-size SVG output (800 by 500 pixels) into the page body using a reusable `scatterPlot` component built with D3’s `select` API. The component is configured via chained methods (`.width`, `.height`, `.data`, `.xValue`, `.yValue`) and attached to the SVG through `svg.call(plot)`. The data is hardcoded in the `index.jsx` file, and rendering relies on SVG elements generated through D3’s selection and layout functions.

AI-generated description
MIT Licensed

Similar vizzes