Skip to main content
100%

Reusable D3 Scatter Plot

✓ Published1🌍 Public
SSubhendu Karmakar
Last edited Dec 9, 2023
Created on Dec 9, 2023

This example demonstrates a reusable scatter plot using D3 v6, rendering the classic Iris dataset with petal length on the x-axis and sepal length on the y-axis. It uses `d3.scaleLinear` for positioning, `d3.scaleOrdinal` with `d3.symbols` to encode species as distinct symbol shapes, and `d3.axisLeft`/`d3.axisBottom` for axes. The plot is built as a modular factory function that accepts configurable accessors for dimensions, margins, and symbol size, then renders SVG paths via `d3.select` and `join`. Data is loaded asynchronously from a GitHub gist CSV.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes