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
+1
-1
@@ -72,7 +72,7 @@ module Maptool
|
||||
"geometry" => { "type" => "MultiLineString", "coordinates" => lines },
|
||||
"properties" => { "kind" => "track", "name" => child_text(trk, "name"), "activity_type" => child_text(trk, "type") }
|
||||
.merge(TrackStats.compute(all_points, times: times))
|
||||
.merge("profile" => TrackStats.build_profile(all_points, extras: extras)),
|
||||
.merge("profile" => TrackStats.build_profile(all_points, times: times, extras: extras)),
|
||||
}
|
||||
end
|
||||
private_class_method :track_feature
|
||||
|
||||
Reference in new issue
Block a user