Pie Multiples with Nesting
This example uses nested pie charts to compare flight volumes by origin airport and carrier, with each donut representing one airport and its arcs sized by the proportion of total flights for that origin. The data comes from a CSV file mapping origins, carriers, and flight counts. The code employs D3's `d3.nest` to group rows by origin, `d3.layout.pie` for angle encoding, and `d3.svg.arc` with dynamic inner and outer radii scaled by the airport’s total flights. Color is assigned via `d3.scale.category20c`, and labels rotate to follow arc centroids.
AI-generated descriptionAn example of multiple pie (donut) charts created with D3. The data is represented as a tabular array of objects; each row in the table is mapped to an arc, and rows are grouped into pie charts using d3.nest.