Heart Rate Sparkline

Source: components/home/hr-sparkline.tsx
What You See
A small area chart showing your average heart rate per day over the last few weeks. The line goes up and down as your heart rate changes. On the right side you see your average and maximum heart rate numbers.
How the Numbers Work
Each point on the chart is the average heart rate from all your activities on that day. The average and max numbers are calculated across the entire window of data shown.
Step by Step
The backend queries all activities within the display window (typically 21-30 days) and computes the arithmetic mean of average heart rate across all runs on each day. If multiple runs happen on one day, they are averaged together. The response contains an array of date/mean-HR pairs plus the overall window average and the maximum single-day value. No ML is involved -- this is a straightforward aggregation from the activities table.