Repository navigation
Allow for distance-based x-axis for elevation charts - #41
Merged
walkersutton merged 2 commits intoAug 31, 2026
Merged
Conversation
|
@KristianKarl is attempting to deploy a commit to the Walker Sutton's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
I noticed now that I built my PR against release 0.3, not main. I guess that's why The PR has conflicts. |
Add an optional `x_axis: "distance"` setting on plot elements so the elevation chart (and other non-course scalar plots) can plot against distance travelled instead of evenly spaced samples (time at constant frame rate). Exposed as a toggle under the chart's Advanced panel. Default remains the time/sample-index axis; course and distance plots are unaffected.
KristianKarl
force-pushed
the
feat/elevation-distance-x-axis
branch
from
August 4, 2026 15:58
b73f6fc to
32f6dca
Compare
Contributor
Author
|
I uploaded 2 screenshots of distance and time based elevation profile at https://gist.github.com/KristianKarl/3fa6bd98658e46ad929a033b6dafdb45 |
Follow-ups on the distance-based x-axis: - Sample the banded fill across the x range rather than the sample index when x is monotonic. Under a distance axis the two diverge: index stepping spends most columns on the dense slow sections and leaves the wide fast ones with a handful of vertices, quantising band edges to ~100px. Course plots keep index stepping — their x is longitude and doubles back. - Fall back to sample indices when the distance array has no span (indoor rides, tracks with repeated coords), which would otherwise collapse every point onto the left edge of the plot. - Offer the toggle on every non-course, non-distance plot instead of elevation alone. The backend already applied x_axis to any scalar, so switching an elevation plot to speed left the setting applied with no UI to see or clear it. - Match the established switch-row tokens, and document x_axis on the PlotElement typedef. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional
x_axis: "distance"setting on plot elements so the elevation chart (and other non-course scalar plots) can plot against distance travelled instead of evenly spaced samples (time at constant frame rate). Exposed as a toggle under the chart's Advanced panel.Default remains the time/sample-index axis; course and distance plots are unaffected.
The problem I wanted to solve was that using a "time based", or evenly spaced samples, climbs looks very steep on the descents as opposed to the ascents. It not a problem per se, but I wanted an alternative that was distance-based.
This PR might not be the optimal implementation (it was co-authored by open-code), but I test it byrendering an activity, which looked okay.
I wanted to at least showcase that it worked.