Skip to main content
100%

reusable D3 scatterplot

✓ Published2🌍 Public
SSamuele Greco
Last edited Feb 9, 2022
Created on Feb 9, 2022

This reusable D3 scatterplot displays the classic Iris dataset, plotting petal width against sepal length with points colored by species via a categorical color scale. The visualization is built as a custom D3 function that returns a chart component, configured through fluent setter methods for dimensions, margins, data accessors, and radius. Using SVG rendering, the code applies `scaleLinear` for both axes, `scaleOrdinal` with `schemeCategory10` for categories, and `axisLeft`/`axisBottom` for ticks. The scatterplot is rendered inside a React-compatible structure despite using plain D3 selections.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes