Average Light Sleep Duration vs. Age
This visualization shows how average light sleep duration changes across age, using a scatter plot with one point per age group derived from a sleep efficiency dataset. The y-axis displays the aggregated mean light sleep percentage, while the x-axis maps age from 0 to 90 years. The code uses d3.csvParse to load the data, d3.flatRollup to summarize records by age and sleep metrics, and d3.scaleLinear with d3.axisLeft and d3.axisBottom for the axes. It also includes a dropdown menu, though the current view is fixed to light sleep.
AI-generated descriptionThis is a viz on the sleep efficiency dataset. The question this viz aims to answer the question how does age correlate with certain feautres of the dataset. This graph looks at age vs average light sleep duration.
To do: add tool tip for hovering over data