Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Reusable D3 Scatter Plot

Public visualization

Viewing a saved revision (read-only)

cbc1fd6522174235bfe4a65de3af65c8

Reusable D3 Scatter Plot

0 stars0🌍 Public
Wwspwll@gmail.com
Last edited Jul 18, 2024
Created on Jul 18, 2024
Forked from D3 Scatter Plot

This example demonstrates a reusable scatter plot of the Iris dataset, mapping petal length on the x-axis and sepal length on the y-axis. It shows how to build a modular chart component using D3 v7. The code defines a `scatterPlot` factory function that returns a customizable object with `width` and `height` setters, which is then invoked via `svg.call()`. Data is loaded asynchronously with `d3.csv` and parsed into numeric values, while scales and axes are created using `d3.scaleLinear`, `d3.axisLeft`, and `d3.axisBottom`. The plot fills the browser window with SVG rendering.

AI-generated description