Scatter plot
✓ Published0🌍 Public
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 descriptionMIT Licensed