Skip to content

Add selection line and width/height options, layout tweaks - #5

Merged
db9795 merged 2 commits into
mainfrom
feat/selection-line-and-size-options
Oct 8, 2026
Merged

db9795 merged 2 commits into
mainfrom
feat/selection-line-and-size-options

Conversation

@db9795

@db9795 db9795 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Adds a highlighted line within the drag selection, makes the SVG size configurable and adjusts the layout so larger font sizes (e.g. when the profile is displayed small) aren't clipped.

Selection line

  • New selection-line element: the part of the line within the selection is drawn on top of line, clipped to the selected x range only, so its stroke isn't cut at the top.
  • selection-rect and selection-line use --maptoolkit-elevation-profile-accent by default.

Width/height options

  • New options width and height (default 900 × 320) set the SVG viewBox and with it the aspect ratio. Fonts and margins are in viewBox units, so a smaller viewBox makes the text relatively larger. Invalid values throw.

Layout

  • More padding around the plot (top 36, right 24, bottom 56, left 94; before 16 / 20 / 40 / 70).
  • Section bars 16 high (before 10), 6 apart (before 4), 8 below the plot (before 4), x labels 11 below the bars (before 7).
  • Hover badge 15 from the top right corner of the SVG. It is now positioned after measuring, so its top no longer shifts with the badge font size set in CSS. Wider gap between dot and text, larger line height.

Other

  • Error messages are in English.
  • README (options, styling) and tests updated.
  • Changesets: minor for the selection line and the size options, patch for the padding and the error messages.

The default look changes: the plot area is smaller and the selection is drawn in the accent color instead of the line color. Custom CSS for selection-rect still applies.

@db9795
db9795 merged commit 1afe3b5 into main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant