Skip to main content
100%

Average Sleep Duration vs. Age

✓ Published1🌍 Public
MMartha Cash
Last edited Apr 11, 2023
Created on Apr 11, 2023

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 description

This 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

MIT Licensed

Similar vizzes