🌍 Public
Viewing a saved revision (read-only)
3cff49d8e04a44939092d580decbc74f
D3_vanilla_html_Scatterplot
This example presents a scatterplot of the Iris flower dataset, plotting petal length against sepal width. Each point is colored by species using a d3.scaleOrdinal with a custom color scheme, and d3.axisLeft and d3.axisBottom render the axes. The code loads CSV data via d3.csv, parses numeric fields, and maps data to pixel coordinates with d3.scaleLinear. SVG circles are joined to the data using selection.join, with a toggle function that can hide or show a line element, though that line is not initially rendered.
AI-generated description