v0.13.7
Step 7 — Tooltip
The Elevation block's cursor now carries a top-pinned tooltip showing the interpolated distance and elevation at the cursor's fraction. The tooltip follows the cursor horizontally and flips to the left side with 0.5em hysteresis when it would otherwise clip the plot rectangle's right edge.
Highlights
- Top-pinned anchor with horizontal-only flip. The tooltip's
yis constant atplotRect.y + 0.5em; onlyxchanges with the cursor. A 0.5em hysteresis band prevents flip oscillation at the threshold. - Locale-aware deterministic formatting. Distance line uses the same m/km threshold as the x-axis ticks (below 2000 m → metres, above → km with 1 decimal); elevation line is always in metres.
Intl.NumberFormatwith the site locale handles separators and grouping. - Per-row visibility toggles.
tooltipShowDistanceandtooltipShowHeightindependently gate each row. When both are off, the tooltip group is not rendered. showCursor-coupled hide-on-master-off. When the Cursor master toggle is off, the tooltip group is not emitted and the entire tooltip inspector surface (Tooltip info PanelBody, three tooltip Color rows, two Tooltip typography PanelBodies) disappears.- Cross-block sync is automatic. Map's cursor scrub writes
state[ mapId ].fraction; the same fraction read drives both Elevation's cursor and its tooltip in lockstep. - No state-payload growth. The per-mapId slice still has
samples,statistics,fractiononly. The two new row toggles travel viadata-wp-contextper block. - Nine new colour + typography surfaces.
tooltipBackgroundColor,tooltipDistanceColor,tooltipHeightColorplus eight typography attributes per row × two rows. Server-side wired throughColor_Sanitizer/Typography_Sanitizer; SCSS defaults fall back to#000000cc/#ffffff/#dddddd/inherit.
Cleanups
geometry/cursor.tssplit intogeometry/sample-interpolation.ts; the SVG DOM helpers in root-levelcursor.tsstay.createTextMeasurer( svg, className? )gains an optional class parameter so tooltip-row measurements pick up their class-scoped typography.