diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 20:37:54 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 20:37:54 +0200 |
| commit | 99e32b642e65d51aaf34a2047b82d3f4baaa3f03 (patch) | |
| tree | 64ea4d4d80bfcc092bb09eb98e8de47ad9262622 /web/frontend/climb-profile.ts | |
| parent | e82599233fa579f665c62636389ab2dc27b10d2a (diff) | |
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.
Diffstat (limited to 'web/frontend/climb-profile.ts')
| -rw-r--r-- | web/frontend/climb-profile.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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 => { |
