Reusable Scatterplot 101
✓ Published1🌍 Public
This example demonstrates a reusable scatterplot component that visualizes the Iris dataset, plotting petal length against sepal width for individual flowers. The code implements a closure-based scatterplot factory using d3.scaleLinear for scales, d3.axisBottom and d3.axisLeft to generate axes, and d3.csv to load data from a GitHub gist. The component accepts configurable accessors for x and y values, along with width, height, margin, and radius properties, then renders circles via SVG selections. The visualization is built with d3-selection’s join pattern to bind data to circle elements.
AI-generated descriptionMIT Licensed