Skip to main content
100%

Reusable D3 Scatterplot

✓ Published1🌍 Public
Rrespingu
Last edited Oct 6, 2022
Created on Oct 5, 2022
Forked from D3 Scatterplot

This example shows a reusable D3 scatterplot built with React, displaying the Iris dataset with petal width on the x-axis and sepal width on the y-axis. The code defines a configurable `scatterPlot` component using `scaleLinear` and `axisLeft`/`axisBottom` from D3 v7, rendering SVG circles with tooltips. It loads data via `d3.csv` from a remote URL, and the plot adapts to the window size. The component’s chainable setter functions allow customization of dimensions, margins, and data mappings, demonstrating a flexible, modular approach to chart construction.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes