Skip to main content
100%

Fork of Reusable D3 Scatter Plot

✓ Published0🌍 Public
YYashwanth0311
Last edited Mar 20, 2024
Created on Mar 20, 2024

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 description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes