SDA HW2-1
✓ Published0🌍 Public
This example shows the survival outcomes of Titanic passengers as a pie chart, separating the data into two categories: those who survived and those who died. The chart uses D3 v6 to load a CSV dataset from a GitHub gist, then computes aggregate counts for each outcome. The visualization is rendered as SVG using D3’s `pie` and `arc` generators, with a categorical color scale assigning green to survivors and red to non-survivors. A custom HTML legend is built alongside the chart to label each slice with its corresponding count, and extra elements like the initial heading are removed for a clean presentation.
AI-generated descriptionMIT Licensed