Skip to main content
100%

basic sleep data

✓ Published1🌍 Public
KKristopher Skelton
Last edited May 11, 2022
Created on Feb 25, 2021
Forked from Load Data with D3

This interactive scatter plot visualizes sleep duration and bedtime across moon phases, with each bar representing one night of Fitbit sleep-tracking data. The x-axis marks moon phase values from 1 to 29, while the y-axis displays time of day, showing end-of-sleep hour and duration in hours. The React app uses `scaleBand` and `scaleLinear` from d3.v5 to position rectangular marks in an SVG. Data is fetched asynchronously from a JSON gist, with moon phases calculated via a simple algorithm and timestamps parsed using `timeFormat`.

AI-generated description

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