PIRX Docs
Dashboard

Sport Projection Card

Source: components/home/sport-projection-card.tsx


What You See

A compact card that appears for non-running sports like cycling, swimming, or hiking. It shows the sport-specific event name at the top (like 'Cycling FTP' or 'Swimming CSS'), the projected value in large bold text (like '245' watts or '1:42' per 100m), a trend icon (arrow up or down), and the supported range below. If available, a small 'Source' label shows which prediction model produced the value.

How the Numbers Work

For non-running sports, PIRX tracks sport-specific performance metrics instead of race times. Cycling uses FTP (Functional Threshold Power) in watts. Swimming uses CSS (Critical Swim Speed) in seconds per 100m. Trail running uses GAP (Grade Adjusted Pace). Nordic skiing uses FTP in watts. Hiking uses VAM (Vertical Ascent Meters per hour). The projected value, range, and trend are calculated by the same projection engine but adapted for the sport's unit of measurement. For units where higher is better (watts, m/hr), the trend arrow points up for improvement. For time-based units (sec/100m, sec/km), the trend arrow points down for improvement (faster is lower).

Step by Step

The backend classifies each synced activity by sport category (running, cycling, swimming, hiking, etc.). For non-running sports with enough data, the projection engine computes a sport-specific projection using the same feature pipeline but with sport-appropriate metrics. The response includes the projected value, range (low and high bounds), unit, and model source. The frontend looks up the event key in a SPORT_EVENT_CONFIG map to get the display name and metric label. Values are formatted by formatSportValue which handles unit-specific display: watts show as integers, time-based units show as M:SS, and vertical speed shows as m/hr with rounding.

On this page