🌍 Public
Viewing a saved revision (read-only)
a66c6a4bdb6244c1ac722dc515a461f7
Assignment 2 Question 1
This example shows the distribution of fruit categories using a pie chart, with each slice sized according to the value in the "4-5" column from a remote CSV file. The visualization renders as an SVG using D3 v7, with colored slices, a bold title, and an interactive legend that displays category names. D3's `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` APIs generate the chart and color scheme, while the legend uses `rect` and `text` elements to map colors to categories. The data is fetched via `d3.csv` from a GitHub gist, and labels for "Category" and "Percentage" are added as static text elements.
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.