🌍 Public
Viewing a saved revision (read-only)
6922656d0ace4aca82124f21588ce7dc
Activity6_Tutorial3.1
This example visualizes the Iris dataset with a scatter plot, mapping petal length and petal width on the x- and y-axes while coloring each point by species (setosa, versicolor, virginica). The SVG rendering uses D3 v6’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` to position and label the axes, with circles sized at a fixed radius. Data is loaded asynchronously via `d3.csv` from a GitHub raw URL, and each mark’s fill color is assigned through a custom switch statement. Axis labels are added as SVG text elements with rotated and centered styling.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.