Average Sleep Duration vs. Age
This visualization shows how average sleep duration varies with age, plotting aggregated data from a sleep efficiency dataset as circles on a scatterplot. The display updates to show other sleep metrics—including efficiency, deep sleep, light sleep, and REM sleep—through a dropdown menu. Built with D3 v7, the code uses scaleLinear for axes, flatRollup to aggregate data by age, and the scatterPlot module to render circles. Data is loaded from a remote CSV file, with axis labels provided by a separate axes module.
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 sleep duration.
To do: add tool tip for hovering over data