-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add sidebar tab with route analysis data #304
Conversation
- adds a new analysis tab in the sidebar - the analysis tab shows length distribution for different way types, surface, and smoothness - table rows can be hovered/clicked to highlight the according segments on the map (similar behaviour as the detailed data table) - localization is implemented for `de` and `en` - the method for finding segment edges was extracted from `js/control/TrackMessages.js` into `js/util/TrackEdges.js` as it's used in the new analysis class too (the Gulp config was changed to reflect that) Notes: I had the idea to use the *DataTable* plugin for rendering the tables but decided against it. The only meaningful way to sort such a table is by the length column and that's already the case. So it's just three plain, old HTML tables, rendered by jQuery. For meaningful statistics the `processUnusedTags` setting has to be enabled in the routing profile. Only in this case the BRouter backend includes all needed tags (`highway`, `surface`, and `smoothness`) for *every* route segment in the response. I’ve enabled that setting for all profiles at my BRouter-web instance at <https://brouter.m11n.de/>.
A side note on translation: we do not support adding translations directly yet (eg |
Is the translation workflow somewhere documented? |
Unfortunately no, I'll begin a CONTRIBUTING.md to add notes about that! |
i18next removed new dynamic keys under "sidebar.analysis.data" by PR #304, leaving them off for now; the rest is resorting
Thanks for your contribution, great addition! I copied the German translations manually over to Transifex. For the tag value translations see #306. |
Regarding |
I committed a fix for the sort compare function in 71317b8. The return value of the sort compare function is defined as value less, equal or greater than 0, not as boolean. For some reason sorting worked in Firefox anyway, but not in Chromium. |
Thanks! |
de
anden
js/control/TrackMessages.js
intojs/util/TrackEdges.js
as it's used in the new analysis class too (the Gulp config was changed to reflect that)Notes:
I had the idea to use the DataTable plugin for rendering the tables but decided against it. The only meaningful way to sort such a table is by the length column and that's already the case. So it's just three plain, old HTML tables, rendered by jQuery.
For meaningful statistics the
processUnusedTags
setting has to be enabled in the routing profile. Only in this case the BRouter backend includes all needed tags (highway
,surface
, andsmoothness
) for every route segment in the response. I’ve enabled that setting for all profiles at my BRouter-web instance at https://brouter.m11n.de/.