Custom of Reusable D3 Scatter Plot
✓ Published0🌍 Public
This example demonstrates a reusable scatter plot built with D3 v7, visualizing the classic Iris dataset. It maps petal length and sepal length to x and y positions using `d3.scaleLinear` and `d3.extent` for domains, with circles rendered in SVG. The code defines a custom `scatterPlot` function that configures accessors, margins, and radius, then applies it to the chart via `selection.call()`. Axes are generated with `d3.axisLeft` and `d3.axisBottom`. The view fills the entire browser window, and circular marks include tooltip titles.
AI-generated descriptionMIT Licensed