Add a Distance/Time toggle to the profile chart's x-axis
TrackStats.build_profile now also computes elapsed_secs per point (relative to the first known timestamp), alongside the existing cumulative distance. Point x-positions stay distance-based either way — only the shared axis strip's 5 tick labels (and the tooltip) switch between the two, so toggling is a cheap re-render rather than rebuilding the charts. The toggle only appears when a track actually has elapsed-time data to switch to.
This commit is contained in:
1 parent
4f7fe3c2a4
commit
a0476f1204
7 files changed
+138
-14
No files matched your search
@@ -619,6 +619,52 @@ html, body {
|
||||
bottom: 2px;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-toggle {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-toggle-btn {
|
||||
border: 1px solid #e1e0d9;
|
||||
background: #fcfcfb;
|
||||
color: #52514e;
|
||||
font-size: 11px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-toggle-btn.active {
|
||||
background: #0b0b0b;
|
||||
border-color: #0b0b0b;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis {
|
||||
position: relative;
|
||||
height: 14px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-tick {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transform: translateX(-50%);
|
||||
font-size: 10px;
|
||||
color: #898781;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-tick:first-child {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.profile-panel__xaxis-tick:last-child {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
.profile-panel__tooltip {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
Reference in new issue
Block a user