From 99e32b642e65d51aaf34a2047b82d3f4baaa3f03 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 18 Oct 2026 20:37:54 +0200 Subject: Draw climb profile sections where the slope changes Fixed distance buckets averaged short steep ramps into their bucket: a 300 m @ 12 % pitch inside a 10 km climb reported ~7-8 % for 500 m. Sections now come from the base-grid elevation polyline split at its widest bends, up to a 24 section budget, so ramps keep their own step and label. Labels are dropped only when they would collide, and the distance axis uses a uniform 0.1-10 km step instead of one tick per (now irregular) section. --- web/frontend/climb-profile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/frontend/climb-profile.ts') diff --git a/web/frontend/climb-profile.ts b/web/frontend/climb-profile.ts index 8910349..6051ec1 100644 --- a/web/frontend/climb-profile.ts +++ b/web/frontend/climb-profile.ts @@ -1,5 +1,5 @@ import { drawOfficialSections, officialProfilePlot, resolveOfficialProfileColors } from "./official-climb-profile.js"; -import { displayStepForLength, officialProfileSections } from "./official-climb-profile-logic.js"; +import { officialProfileSections } from "./official-climb-profile-logic.js"; import type { OfficialProfileSection } from "./official-climb-profile-logic.js"; import type { ProfilePoint } from "./types.js"; @@ -24,7 +24,7 @@ const climbProfilePoints = (payload: ClimbProfilePayload): ProfilePoint[] => const climbProfileSections = (payload: ClimbProfilePayload): OfficialProfileSection[] => { const points = climbProfilePoints(payload); if (points.length < 2) return []; - return officialProfileSections(points, 0, points.length - 1, displayStepForLength(payload.distanceKm * 1000)); + return officialProfileSections(points, 0, points.length - 1); }; const elevationAtDistance = (sections: OfficialProfileSection[], distanceKm: number): number | null => { -- cgit v1.3