🌍 Public
Viewing a saved revision (read-only)
571bde2d05ee40f0a5f622988400c011
reusable scatter plot
This reusable scatter plot displays age against fare price, with points colored by gender. The visualization alternates between two halves of the dataset every five seconds using `setInterval`, clearing the SVG and re-rendering with D3’s `selectAll` and `join` pattern. It uses `scaleLinear`, `scaleOrdinal`, `extent`, and `axisLeft`/`axisBottom` from D3 v6 to build axes and scales. The custom `scatterPlot` function exposes chainable methods for width, height, margins, and radius, while the data loads from a CSV URL via `d3.csv`.
AI-generated description