Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

reusable D3 scatterplot

Public visualization

Viewing a saved revision (read-only)

cf0d7700c9df4feda0f19a6cd09adc68

reusable D3 scatterplot

0 stars2🌍 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.