summaryrefslogtreecommitdiff
path: root/web/frontend/official-climb-profile-logic.ts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-16 15:03:54 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-16 15:03:54 +0200
commit283c876aff2c1a5477955140df783a70ab76dbd8 (patch)
tree5a3dbdce25e549fbed983ed839fdad39c9d3d21f /web/frontend/official-climb-profile-logic.ts
parentdf7c9b5130ba193fc918a947a461f2a70dc2dd3c (diff)
feat(web): improve official climb profile
Diffstat (limited to 'web/frontend/official-climb-profile-logic.ts')
-rw-r--r--web/frontend/official-climb-profile-logic.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/web/frontend/official-climb-profile-logic.ts b/web/frontend/official-climb-profile-logic.ts
index 1b2bc83..893588d 100644
--- a/web/frontend/official-climb-profile-logic.ts
+++ b/web/frontend/official-climb-profile-logic.ts
@@ -14,12 +14,11 @@ const profileStepSizesM: number[] = [100, 200, 500, 1000];
const displayStepForLength = (lengthM: number): number =>
profileStepSizesM.find((stepM) => Math.ceil(lengthM / stepM) <= 30) || profileStepSizesM[profileStepSizesM.length - 1];
const profileBandForSlope = (slopePercent: number): ProfileBand => {
- if (slopePercent < 0) return "downhill";
+ if (slopePercent <= 0) return "downhill";
if (slopePercent < 3) return "0-3";
if (slopePercent < 6) return "3-6";
if (slopePercent < 9) return "6-9";
- if (slopePercent < 12) return "9-12";
- return "12-plus";
+ return "9-plus";
};
const officialProfileSections = (points: ProfilePoint[], startIndex: number, endIndex: number, stepM: number): OfficialProfileSection[] => {
const startDistanceM = points[startIndex].distanceKm * 1000;