Skip to main content
100%

Fork of Week 7 – Project Momentum: Color assignment.

✓ Published1🌍 Public
Ccsabavath@wpi.edu
Last edited Oct 20, 2025
Created on Oct 20, 2025

This visualization displays the prevalence of sleep disorders (None, Insomnia, Sleep Apnea) as a 100% stacked bar chart, segmented by binned stress levels (Low, Medium, High) and filterable by gender. A legend allows users to toggle categories on or off, with hover and click interactions updating the display. The chart uses D3 v7’s `d3.stack()`, `d3.scaleBand()`, and `d3.scaleOrdinal()` to compute and color the proportional segments, with smooth transitions applied to bar heights via `transition().duration()`. Data comes from a CSV file on sleep health and lifestyle.

AI-generated description
MIT Licensed

Similar vizzes