Skip to content
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

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

mjaschen
Copy link
Contributor

@mjaschen mjaschen commented Jun 7, 2020

  • 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/.

- 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/>.
@bagage
Copy link
Collaborator

bagage commented Jun 7, 2020

A side note on translation: we do not support adding translations directly yet (eg de.json modifications) since that will be overwritten when pulling from transifex.
If many translations were done, we can upload the json to transifex but carefully to not erase remote translations @nrenner.

@mjaschen
Copy link
Contributor Author

mjaschen commented Jun 7, 2020

A side note on translation: we do not support adding translations directly yet

Is the translation workflow somewhere documented?

@bagage
Copy link
Collaborator

bagage commented Jun 7, 2020

Unfortunately no, I'll begin a CONTRIBUTING.md to add notes about that!

@bagage bagage mentioned this pull request Jun 7, 2020
@nrenner nrenner merged commit f37489c into nrenner:master Jun 8, 2020
nrenner added a commit that referenced this pull request Jun 8, 2020
i18next removed new dynamic keys under "sidebar.analysis.data" by PR #304, leaving them off for now; the rest is resorting
@nrenner
Copy link
Owner

nrenner commented Jun 8, 2020

Thanks for your contribution, great addition!

I copied the German translations manually over to Transifex. For the tag value translations see #306.

@nrenner
Copy link
Owner

nrenner commented Jun 10, 2020

Regarding processUnusedTags I opened an issue:
Process additional tags for analysis · #249 · abrensch/brouter

@nrenner
Copy link
Owner

nrenner commented Jun 12, 2020

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.

@mjaschen
Copy link
Contributor Author

Thanks!

@nrenner nrenner added this to the 0.12.0 milestone Jun 18, 2020
@mjaschen mjaschen deleted the feature/track-analysis branch June 30, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants