🌍 Public
Viewing a saved revision (read-only)
dced4e6de84b4034bca9b43126f5cf1f
Activity 6 tutorial 3.1
This example visualizes the Iris dataset with a scatter plot of petal length against petal width, where each circle’s color encodes the three species (setosa, versicolor, virginica) via a switch statement. The code loads CSV data with d3.csv, maps it into x/y positions using scaleLinear and extent, and renders SVG circles with attributes for fill and radius. Axis labels and tick marks are generated with d3.axisLeft and d3.axisBottom, while an inner text element adds rotated labels for both axes.
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.