diff options
Diffstat (limited to 'web/frontend/ride-detail-logic.ts')
| -rw-r--r-- | web/frontend/ride-detail-logic.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/web/frontend/ride-detail-logic.ts b/web/frontend/ride-detail-logic.ts index e0f7281..b4d4dba 100644 --- a/web/frontend/ride-detail-logic.ts +++ b/web/frontend/ride-detail-logic.ts @@ -29,6 +29,7 @@ export const categoryForCotacol = (cotacol: number): string => { }; type ClimbLabelKind = "official" | "detected"; +export type ClimbBoundary = "start" | "end"; interface ClimbLabelOptions { name: string; @@ -42,6 +43,8 @@ export const formatClimbLabel = ({ name, category, cotacol, kind }: ClimbLabelOp return `${category} ${cotacol.toFixed(1)}`; }; +export const formatClimbBoundaryLabel = (index: number, boundary: ClimbBoundary): string => `Climb ${index + 1} ${boundary}`; + export const elevationAtDistance = (points: ProfilePoint[], index: number, distanceM: number): number => { if (index + 1 >= points.length) return points[index].elevationM; const startDistanceM = points[index].distanceKm * 1000; |