🌍 Public
Viewing a saved revision (read-only)
f2839469d7b548a292c188a6b03c8520
7.1 Question 1
This example shows a fruit distribution pie chart, visualizing the quantity of each fruit in a CSV dataset loaded from a GitHub gist. D3 v5 loads the data with `d3.csv`, converts it to an object mapping fruit names to numeric quantities, and uses `d3.pie` and `d3.arc` to generate the SVG paths. Each slice is filled with a categorical color from `d3.schemeSet2` via `d3.scaleOrdinal`, and labeled with the fruit name using SVG text elements positioned at each arc’s centroid.
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.