🌍 Public
Viewing a saved revision (read-only)
dc8865e1f8714a8fbe3d09f1cfbb9992
ICE-7 Common Visualization Idioms
This example demonstrates a reusable scatter plot comparing CO₂ emissions against GDP for six countries. The visualization positions circles along a linear scale for each variable, with axes, labels, and a title generated dynamically. It uses d3.csv to load the data from a CSV file, d3.scaleLinear for coordinate mapping, d3.extent to determine domains, and d3.axisBottom and d3.axisLeft for the axes. The plot is rendered as an SVG with circles styled in steelblue with partial opacity, and the code encapsulates the plotting logic into the `scatterPlot` function, allowing it to be reused with different data variables.
AI-generated description