Skip to main content
100%

intermediate sleep data

✓ Published1🌍 Public
KKristopher Skelton
Last edited Mar 8, 2021
Created on Mar 2, 2021
Forked from basic sleep data

This interactive sleep data visualization charts nightly sleep duration against lunar phase. Rectangular marks show the end time and duration of each sleep session, while moon phases from new moon (1) to full moon (15) run along the x-axis. The SVG rendering uses React with D3 scales (scaleBand, scaleLinear) and custom axis components. Data is fetched from a Fitbit JSON file and processed client-side to calculate moon phase conversions, remove errant values, and unify duplicate days before sorting and averaging.

AI-generated description

This is a refactor of my simple sleep data project. Of note, in a real application I would not have the front end do all the data manipulation and calculation. I would have Node do this after the API call to fetch the data in a data model.

I'm currently stuck trying to get the average hours of sleep to show up as a scatter plot

Program that loads sleep data from my fitbit account

Moonphase calculated using "simple" from ben-daglish.net's Moon Phase Calculator 0 = New Moon, 15 = Full Moon

MIT Licensed

Similar vizzes