v0.13.4
Step 4 of the GPX Elevation rebuild: both axes carry tick marks and labels driven by the GPX data range.
What's new
- X axis runs from 0 to the bound track's distance and switches between metres and kilometres on a deterministic threshold (
distance < 2000 m→ metres, otherwise km). Ticks are filtered Strava-style so no rendered value exceedsdistance. The first tick is always0. - Y axis runs from a rounded-down floor to a rounded-up ceiling of the elevation range and stays in metres. All generated Y ticks render; the lowest sits on the X axis line and the highest sits at
y = wTop. - Adaptive tick count follows the additive formula
floor((avail + 0.5em) / (refSize + 0.5em)), clamped to ≥ 2. Constant 0.5em luft replaces Step 3's proportional × 1.5 — same visual gap whether labels are"0 m"or"1234 m". - Margins gain
wTopto reserve the upper half of the topmost Y label;wRightis derived from a worst-case reference string keyed ondistance, so margins stay stable across resize and the chicken-and-egg between margins and tick count is broken. - Axis-label colour is wired end-to-end. The existing
axisLabelColorattribute reaches the SVG<text>fills through the new CSS custom property--kntnt-gpx-blocks-elevation-axis-label. The Axis colour continues to drive axis lines and tick marks independently.
Internal
format.ts: newxReferenceString(distance, locale);chooseXUnitswitched to a distance-only oneliner;formatXLabelsgained adistanceparameter.ticks.ts:computeTickCount(avail, refSize, em)adopts the additive luft formula.margins.ts:MarginsgainswTop;wRightkeyed onxReferenceString(distance).chart.tsx/view.ts: render two tick-mark groups and two tick-label groups; redraw onResizeObserverwithout recomputing margins; webfont-aware vialoadingdone.
See docs/elevation-rebuild.md for the full Step 4 spec.