Reusable D3 Scatter Plot
✓ Published0🌍 Public
This example presents a population scatter plot, displaying the relationship between years and population size as individual steel-blue circles. The chart renders in full-screen SVG, with axes and labels for both dimensions. Built with D3 v7, the visualization uses `d3.csv` to load the population dataset, `d3.scaleLinear` for positioning, and `d3.axisBottom` and `d3.axisLeft` to draw the scales. The code is structured as a reusable `scatterPlot` function, which the main script configures via method chaining for dimensions, radius, color, and margins, then binds to the DOM with `d3.select('#chart').call(chart)`.
AI-generated descriptionMIT Licensed