Skip to main content
100%

Scatter Plot of Hours Slept

✓ Published0🌍 Public
KKristopher Skelton
Last edited Mar 9, 2021
Created on Mar 8, 2021

A scatter plot compares hours slept against a lunar phase, with each individual night a gray circle and the average per phase a green circle. A bar chart underlying the plot uses the same axes. The React app fetches Fitbit sleep data, processes it with D3 v5’s `scaleBand` and `scaleLinear`, and renders SVG via React components for axes and circle marks. Moon phase values derive from a simple JavaScript calculation.

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