🌍 Public
Viewing a saved revision (read-only)
0351b274dff44218a9a2722c5060d2de
Reusable Charts
This example demonstrates a reusable D3 chart component that visualizes the Iris dataset as a scatter plot, cycling through different variable pairings every two seconds. The `scatterPlot` function creates a configurable plot with settable properties like width, height, data, x/y value functions, margin, and radius. Using D3’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom`, it renders SVG circles with animated axes that update as the selected columns change. The plot is applied to the SVG via the `.call()` method, and `setInterval` drives the rotation through the dataset’s four numeric columns.
AI-generated descriptionA demonstration of how to start using D3 version 6.