🌍 Public
Viewing a saved revision (read-only)
4e5fdc1d3a294b57bb3c872b7305df8b
SDA HW2-1
This example shows the survival distribution of Titanic passengers with a pie chart comparing the counts of survivors and non-survivors. D3 v5 loads the dataset via `d3.csv` from a GitHub gist, aggregates counts using `d3.rollup`, and renders the chart with `d3.pie` and `d3.arc` into an SVG. The visualization includes labels at each arc’s centroid via `arc.centroid`, a color scale from `d3.schemeSet2`, and an interactive legend built with D3 selections. Axis titles and a chart heading are added as SVG text elements.
AI-generated description