Skip to main content
100%

ReUsable Fork of D3 Scatter Plot

✓ Published1🌍 Public
Ssunole896@yahoo.com
Last edited Dec 4, 2022
Created on Dec 4, 2022
Forked from D3 Scatter Plot

This example presents a scatter plot visualization of the Iris Dataset, displaying the relationship between petal length and sepal length for individual flowers. The plot is built using a reusable D3.js module that encapsulates the chart's configuration, including margins, axis scales, and point radius, making it adaptable to different datasets by specifying custom data accessors for x and y values. The implementation leverages D3’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` APIs to map data to SVG circle elements, with the chart initialized via a chainable setter pattern in the `scatterPlot` function. Data is loaded asynchronously from a CSV file using D3’s `csv` method, and the visualization is rendered responsively to fill the browser window.

AI-generated description

A vanilla HTML implementation of a D3 scatter plot. Shows the Iris Dataset.

MIT Licensed

Similar vizzes