🌍 Public
Viewing a saved revision (read-only)
0685d583ab8043cb9d1aff7ebe312f92
Activity6_Task3
This example shows the classic Iris dataset as a scatter plot, displaying petal length on the x-axis, petal width on the y-axis, and using color-coded circles to distinguish the three species. The plot is rendered as an SVG using D3 v6, with the data loaded from a GitHub-hosted CSV file. The code uses `d3.csv`, `d3.scaleLinear`, `d3.extent`, `d3.axisLeft`, and `d3.axisBottom` to build the visualization. Circle radii are fixed, while circle attributes for width and height are set from the dataset. Axis labels are manually placed with text elements, and species-specific colors are assigned via a switch statement.
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.