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>
+1
View File
@@ -109,6 +109,7 @@ export interface Timeseries {
export interface ActivityDetail extends Omit<ActivitySummary, 'detail_url' | 'track_url' | 'preview_coords'> {
description: string | null;
elevation_loss_m: number | null;
np_power_w: number | null;
max_power_w: number | null;
gear: string | null;
device: string | null;