tankste / backend

The new brain & backend API of tankste! project.
https://tankste.app
Other
0 stars 1 forks source link

fine tuning of color markings #5

Open Marrrrtthias opened 2 years ago

Marrrrtthias commented 2 years ago

The color markings seem very arbitrary. When I open the app right now, pretty much every station in my area is green. Only one in my city is yellow and red is not even used for ANY station shown on the map even when zoomed out.

IMG_2965 IMG_2966

After looking at the code, this seems to be the intended behaviour:

if (minPrice + 0.04 >= price) {
  return StationPriceRange.cheap;
} else if (minPrice + 0.10 >= price) {
  return StationPriceRange.normal;
} else {
  return StationPriceRange.expensive;
}

I would suggest using a different logic for the categorisation. Instead of having a fixed width for each category, in my opinion it would be better to look at the range of prices that actually exist in the area and have an "intelligent" scale: For example if the prices go from min to max:

That way the scale would actually show which stations are the cheapest instead of just showing everything marked as cheap if prices are close together.

Fabi755 commented 2 years ago

Thanks for your feedback and given solution! 💜

My first implementation was based on a similar logic. The main problem are the maximum prices of the stations. Most of the time highways-stations have a very expensive price compared to other stations. What will expand the min - max range on areas with highway near. This will cause that the minimum (10%) range gets bigger then. As result it is not as cheap as it looks.

That is the reason for the static solution. I have compared our current version with the Bertha app and was looking similar.

But now to your idea: Have your tested the suggested solution, do have a better experience with that? I will try it out by myself the next days. And will give feedback here what is my outcome 😄


At this moment the markers look better on Kaiserslautern:

Marrrrtthias commented 2 years ago

I also noticed the highway stations. But to me it still seems better this way for the simple reason that less stations are marked as green. For me and probably most users the green stations are the most important and as such the colors are useless if nearly all stations are marked green as with the current implementation. The current color logic makes it very hard to see which stations are actually cheapest because so many stations are green.

Maybe it would already be enough to simply change the cutoff value and only show stations within 1 or 2 cents of the cheapest station as green. Instead of the current 4 cent cutoff.

Another alternative that I haven't tested and might even be overkill would to use the dynamic price range I am suggesting but marking any stations that are more than 10 cent above the median price as red by default and not including them in the price range calculation at all.

Fabi755 commented 10 months ago

Moved to backend project, while the calculation of markers are done here now.