Add avg power and NP to activity summary; NP uses Coggan 30s rolling-average method

This commit is contained in:
Davide Scaini
2026-05-12 23:47:06 +02:00
parent f1fec6d825
commit bd0595ee79
4 changed files with 54 additions and 1 deletions
@@ -123,6 +123,10 @@
stat('Avg HR', activity.avg_hr_bpm ? `${activity.avg_hr_bpm} bpm` : '—', 'heart_rate'),
stat('Max HR', activity.max_hr_bpm ? `${activity.max_hr_bpm} bpm` : '—', 'heart_rate'),
stat('Cadence', activity.avg_cadence_rpm ? `${activity.avg_cadence_rpm} rpm` : '—', 'cadence'),
...(activity.avg_power_w != null ? [
stat('Avg power', `${activity.avg_power_w} W`, 'power'),
stat('NP', detail?.np_power_w != null ? `${detail.np_power_w} W` : '—', 'power'),
] : []),
].filter(s => !s.key || !hiddenStats.has(s.key));
</script>