Project Momentum Sleep Efficiency Dataset
This visualization compares average sleep metrics by gender using a bar chart of data from a sleep efficiency CSV dataset. A dropdown menu lets users switch between features like sleep efficiency, exercise frequency, caffeine consumption, and sleep-stage percentages. The chart is built with D3 v7, using `scaleBand` for the categorical x-axis and `scaleLinear` for the y-axis, with custom axis labels. Data is fetched as CSV, parsed with `csvParse`, and aggregated on the fly for male and female averages.
AI-generated descriptionNew technique: Use a button that changes the color scheme of the data. This will be useful for implementing the interactivity element portion of this project.
Button element/color: https://d3-graph-gallery.com/graph/barplot_button_color.html Color scheme: https://observablehq.com/@d3/color-schemes Button implementation: https://vizhub.com/curran/9ccb874276ad4e1bac8b03b8eb233aee?edit=files&file=index.html