Skip to content

v0.13.5

Choose a tag to compare

@TBarregren TBarregren released this 13 May 11:18
· 56 commits to main since this release

Step 5 — Elevation curve

Adds the elevation curve as two SVG <path> elements drawn from a server-emitted, LTTB-downsampled (distance, elevation) array. The chart now carries an elevation profile over Step 4's axes and ticks, with an optional translucent fill under the curve.

Highlights

  • New Rendering\Elevation_Samples helper — composes (distance, elevation) extraction with Lttb::downsample(). Both Render_Elevation::render() and Rest\Preview_Controller::get_preview() call it under the filter kntnt_gpx_blocks_elevation_target_points (default 300).
  • LTTB resurrected verbatim from v0.12.0 (Rendering\Lttb + its unit-test suite).
  • Shared ChartScale helper (src/blocks/elevation/geometry/scale.ts) consumed by both editor preview (chart.tsx) and the frontend Interactivity host (view.ts). Eliminates the duplicated projection math both hosts carried.
  • Two <path> elements in the SVG: a closed fill path below the curve and an open stroke path on top. The fill path is always emitted; visibility is governed by the --kntnt-gpx-blocks-elevation-plot-fill CSS variable.
  • New plotFillColor block attribute — total attribute count 35 → 36.
  • Per-mapId state slice gains a samples field; REST response gains the same field for editor previews.
  • Resize behaviour unchanged: margins stay cached, curve re-projects on every resize, stroke width pixel-stable via vector-effect="non-scaling-stroke".

Released-step recap to follow.