Fork of Reusable D3 scatterplot with symbols
✓ Published0🌍 Public
This example presents a reusable D3.js scatterplot that visualizes the classic Iris flower dataset, encoding species with distinct SVG symbols (circles, crosses, and diamonds) via a d3.scaleOrdinal mapping to d3.symbols. The chart maps petal width to the x-axis and sepal length to the y-axis using d3.scaleLinear, with axes generated by d3.axisBottom and d3.axisLeft. The code demonstrates a modular chart factory pattern, where configuration methods like .width(), .data(), and .symbolValue() are chained to customize the plot, following the margin convention and rendering data-loaded CSV values as SVG path elements.
AI-generated descriptionExample Reusable scatterplot
https://www.youtube.com/watch?v=xkBheRZTkaw To 12:31
References
- towards reusable charts, idea is to make components dependend on d3
- see d3 margin convention https://observablehq.com/@d3/margin-convention
MIT Licensed