🌍 Public
Viewing a saved revision (read-only)
055d9d6794ef454fa8df940305c33498
ry0214_Question 1
This pie chart visualizes the species distribution in the Iris dataset, displaying the proportional counts of setosa, versicolor, and virginica flowers. The D3.js v7 code counts occurrences from an embedded array and renders the chart as an SVG using `d3.pie()` for arc generation and `d3.arc()` for path construction. A categorical color scale (`d3.scaleOrdinal`) assigns distinct hues to each species, with white labels positioned at arc centroids. A horizontal HTML legend below the chart matches colored squares to species names. The dataset contains 150 sample records, though only a subset is listed in the provided code stub.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG (pinned at v6, since this runtime environment only supports UMD, and in v7 D3 dropped UMD support)
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.