Repository navigation
Color gradient for numeric path details - #2259
Conversation
|
Can we avoid red/green color shades for colorblind users? |
|
Ah and @boldtrn suggested we should use a special color (like grey) for missing values? I think this is a great idea, but how can we reliably recognize missing details? |
Good point! What colors would be better? |
| // for numeric details we use a color gradient | ||
| var colorMin = [47, 115, 54]; | ||
| var colorMax = [170, 58, 56]; |
There was a problem hiding this comment.
@otbutz The min/max colors are specified here
There was a problem hiding this comment.
For the discrete values I am using these colors right now: https://github.com/d3/d3-scale-chromatic#categorical (schemeCategory10) I thought they are pretty, but not sure if they are accessible.
Using the current GH API you can't. GH uses the country fallback speed. This would require a change in the MaxSpeedParser.
As far as I know, any other color should work, I think you can even use red or green, but should avoid both in the same visualization. So for example we could use blue instead of green (but you are using blue already :)). |
Ah ok. For some encoded values (like road environment) we use 'other', but e.g. for surface we have 'missing'...
How about this: I found this here: https://uigradients.com/#Superman |
e.g |
…or_numeric_path_details
Co-authored-by: Thomas Butz <[email protected]>
|
Funnily enough, this was posted on hackernews just recently: https://blog.datawrapper.de/which-color-scale-to-use-in-data-vis/ |
# Conflicts: # web-bundle/src/main/resources/com/graphhopper/maps/js/map.js



For numeric path details like
timeoraverage_speedits not very useful to use unrelated, random colors in the elevation diagram. Here I am using a linear color gradient for such numeric path details. The gradient uses two fixed colors to represent the minimum/maximum of the encoded value range of the current path (green to red). For discrete values I use a fixed 10-color palette now (leaflet.heightgraph was using a random choice of six color palettes, but to me it seems confusing to see different colors each time).Not entirely sure about this change yet, any opinions @karussell, @boldtrn?
Here are screenshots of a numeric and a discrete path detail:
By the way I use the 10-color palette from d3, but maybe not really worth keeping the entire library when all we need is an array of 10 hex codes...
And thanks again for these changes in heightgraph, they are very useful @boldtrn!
This PR is based on #2258.