Skip to main content
100%

Reusable Charts Notes

✓ Published1🌍 Public
CCameron Wehr
Last edited Sep 16, 2023
Created on Sep 16, 2023
Forked from Scatter Plot Basic

This example demonstrates a reusable scatter plot generated from the Iris dataset, which is loaded as CSV from a GitHub Gist. The chart visualizes the relationship between petal length and sepal length, using D3 version 7’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` APIs to map data values to SVG coordinates and render axes. The code constructs a custom `scatterPlot` function with getter-setter methods for configuration, enabling the chart to be applied to an SVG element via method chaining. The final visualization fills the browser window and is rendered as an interactive SVG.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes