🌍 Public
Viewing a saved revision (read-only)
21b2116faa0a48ef9dcab6cd98f72c6d
reusable scatter plot
This example demonstrates a reusable scatter plot that visualizes inventory data by plotting quantity against price. The visualization alternates between two halves of the dataset every five seconds, automatically switching between the first and second half of the data points. Built with D3.js v6, the code uses `scaleLinear`, `scaleOrdinal`, and `schemeCategory10` for color encoding, while axis and label rendering rely on `axisLeft` and `axisBottom`. The custom `scatterPlot()` function encapsulates chart configuration through chainable methods, and data is loaded from a CSV file using `d3.csv`.
AI-generated description