-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excessive approximation of time ticks (large tracks) #170
Comments
Hi velocat, these should be the lines you should check (it could be related to the Axis: Line 34 in ac803fd
Line 49 in ac803fd
leaflet-elevation/src/utils.js Lines 48 to 65 in ac803fd
Mouse Tooltip: Line 107 in ac803fd
leaflet-elevation/src/chart.js Line 812 in ac803fd
Have a nice day, |
I think this is due to a principled approach. This scale shows the time calculated according to the time specified in the track. It would probably be more logical to use an increment in the scale as well. Note: Track recording can be stopped, for example, overnight, and then continued the next day, the next day. As it seems to me, this is what causes the difference, though... need to test more precisely with different tracks. |
if I'm not mistaken this is a problem related to how d3js handles the creation of the ticks on the time axis scale, you can check it as follows: Line 49 in ac803fd
// CHANGE that line inside time.js
tickFormat : (d) => {
console.log("Duration: " + _.formatTime(d || 0) + ' {' + d + '}');
return (d == 0 ? '' : opts.xTimeFormat(d))
}, // ADD this line inside time.js
this._registerFocusLabel({
name: 'time',
chart: (item) => "Duration: " + _.formatTime(item.duration || 0) + ' {' + item.duration + '}'
}); For some reason it only considers values that are multiples of 10 (eg. 50000000, 100000000, 150000000, 200000000, 250000000) |
Here you can find some usage examples: and this could be the offending portion: leaflet-elevation/src/components.js Lines 77 to 82 in ac803fd
leaflet-elevation/src/components.js Lines 392 to 394 in ac803fd
|
This is the reason: leaflet-elevation/src/index.css Lines 39 to 42 in ac803fd
if you want to investigate further you can start from here: leaflet-elevation/src/chart.js Line 238 in ac803fd
There is also an initial speed of 0.01 km/h (and a slope of -600% ...), maybe they are related issues. As usual anyone interested in solving this is welcome (honestly for my current use of this library these advanced stats are quite overkill...) Have a nice day, |
Okay, I deleted my comment because I thought it wasn't right. But now I tested it on an extreme track: The first quarter and the last quarter of the track went very fast, the 2nd super slow, the third a little slower than the first and last quarter. Unfortunately, in the 2nd quarter my gps device quit. |
Subject of the issue
After it became possible to see the duration in the tooltip, I noticed that on large tracks the upper scale is displayed incorrectly. It displays a completely different time than in the hint.
This is not observed on short tracks.
Is it difficult to understand what is wrong? For understanding, I give a link to a branch with this example and screenshots.
Steps to reproduce
https://github.com/velocat/leaflet-elevation/tree/TestTrack
https://jsfiddle.net/velocat/pwyLxb9u/1/
The text was updated successfully, but these errors were encountered: