Fork of Reusable D3 Scatter Plot
This example demonstrates a reusable scatter plot that cycles through different dimension pairings of the classic Iris dataset. Initially displaying petal width against sepal length, the visualization automatically swaps the x-axis variable every two seconds, exploring all four measurement combinations. The plot is built using a custom `scatterPlot` function that leverages D3's `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` APIs for scaling and axis rendering. The animation is driven by `setInterval` in the main script, which updates the chart's x-value binding and re-renders the SVG via the `.call(plot)` method, all based on data fetched from a GitHub-hosted CSV file.
AI-generated descriptionA reusable scatter plot inspired by Towards Reusable Charts.
Shows the Iris Dataset.