Travel Mapping

Web Design Discussion => General Web Design Discussion => Topic started by: Jim on December 19, 2017, 09:11:28 pm

Title: HB: traveler mileage and percent
Post by: Jim on December 19, 2017, 09:11:28 pm
Code addressing the main feature requested in

https://github.com/TravelMapping/Web/issues/218

is now in the HB on tmtest.  Please give it a try.  I think it's pretty straightforward, but I'd like to get a little feedback before going live with it on the production site.

(Grades went in for the semester, and I felt I should knock off at least one item from the TM backlog before taking care of a bunch of other work-related items I have been putting off.)
Title: Re: HB: traveler mileage and percent
Post by: mapcat on December 19, 2017, 09:40:44 pm
Found a bug:

http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca163 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca163)

(I just selected the route at random)

Even though I'm listed among those who have clinched the route, and my length traveled (10.87 mi) equals the total length (also 10.87 mi), my percent traveled is 99.97%.

Similar situation on two more short clinched routes:

http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca056 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca056)
http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca282 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.ca282)

Note that, for CA282, a route clinched by everyone who's driven it, the average traveled is 100.00% even though users are credited with 100.6%.

Longer routes don't have the problem:

http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i005 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i005)
http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i010 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i010)
http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i040 (http://tmtest.teresco.org/hb/?units=miles&u=mapcat&r=ca.i040)



Title: Re: HB: traveler mileage and percent
Post by: Jim on December 19, 2017, 09:55:57 pm
Ah, a rounding problem.  Thanks for finding it.  I think I've fixed it.
Title: Re: HB: traveler mileage and percent
Post by: mapcat on December 19, 2017, 10:04:17 pm
Looks good!
Title: Re: HB: traveler mileage and percent
Post by: yakra on December 20, 2017, 04:47:43 am
Straightforward, and cleanly presented. As @mapcat noted on GitHub, we can compare our percent travelled to the average. I like.
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 20, 2017, 08:06:18 pm
This first improvement is now on the main site.  I'll see if I can implement the highlighting of segments in the waypoint table next.
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 20, 2017, 10:53:24 pm
Highlighting in the waypoint table for segments traveled by the selected user is now on tmtest.  Give it a look if you have a chance.
Title: Re: HB: traveler mileage and percent
Post by: mapcat on December 21, 2017, 12:32:29 am
Looks good to me. It's already helped me identify a short unclinched segment that's almost impossible to see on the map.
Title: Re: HB: traveler mileage and percent
Post by: michih on December 21, 2017, 04:28:23 am
It's already helped me identify a short unclinched segment that's almost impossible to see on the map.

There could be a "Goto first unclinched segment" button. On clicking, the marker box on the map could appear...

The last row should automatically get the same color like the second to last row.
Title: Re: HB: traveler mileage and percent
Post by: mapmikey on December 21, 2017, 06:20:30 am
Looks good to me. It's already helped me identify a short unclinched segment that's almost impossible to see on the map.

No idea how hard this would be...

How about an 'inverse' button that switches the bolded lines on the map to the unclinched segments...?
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 21, 2017, 07:40:52 am
It's already helped me identify a short unclinched segment that's almost impossible to see on the map.

There could be a "Goto first unclinched segment" button. On clicking, the marker box on the map could appear...

A couple reasons not to do it at least not right away.  I hesitate to add more UI elements for something like that, and the page doesn't really store that kind of information for dynamic behavior.  At this point, the colors in the tables and on the map are set on creation and there's no information stored to allow such a search.

Quote
The last row should automatically get the same color like the second to last row.

My hesitation on this is because I think it would somehow imply two clinched segments at the end when one really exists.  The way to think about the table's colors is to see the segments that start at each point that are clinched or not.  It would be impossible to clinch a segment starting at the end.
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 21, 2017, 07:42:23 am
No idea how hard this would be...

How about an 'inverse' button that switches the bolded lines on the map to the unclinched segments...?

Something to think about.  With the current code structure, I think this would require a page reload.  I'd like to put that off pending a better way to select colors overall.
Title: Re: HB: traveler mileage and percent
Post by: michih on December 21, 2017, 09:56:36 am
The last row should automatically get the same color like the second to last row.

My hesitation on this is because I think it would somehow imply two clinched segments at the end when one really exists.

As it is today. If you have clinched the entire route, the last segment is still indicated unclinched.... That's why I suggested to use the color of the previous segment. Who really cares about the number of segments traveled?
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 21, 2017, 01:35:37 pm
I don't know how hard it would be, but here's something I think would make some sense. 
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 21, 2017, 01:51:55 pm
Related to this, I'd like to replace the light pink to dark pink scale currently used to map percentages with something nicer.  One possibility is a scheme like CHM's, where high percentages are blue (or close) and low percentages are orange.  I never liked that a whole lot but I am also not sure what a better scale should look like.  I'd like to come up with a scheme and apply it in maps and tables throughout TM. 

Suggestions?
Title: Re: HB: traveler mileage and percent
Post by: michih on December 21, 2017, 04:14:02 pm
I wrote this earlier today but removed it again because I thought it's just nitpicking :)

I don't like the dark pink/red tone of the left column but the rest is fine to me (because the right color is usually not clinched by 100% of the users). I think the color should be similar to the "traveled" color of the graph on the map to have a "visual link". If OSM is the default map I don't see any other color looking better on the map...

Again, I only don't like the dark pink/red in the table... Maybe we can just make the 100% color a little bit brighter? Not sure but I think the graph color is similar to the 70+% color in the table. Maybe this should make it?
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 21, 2017, 04:19:42 pm
I wrote this earlier today but removed it again because I thought it's just nitpicking :)
Again, I only don't like the dark pink/red in the table... Maybe we can just make the 100% color a little bit brighter? Not sure but I think the graph color is similar to the 70+% color in the table. Maybe this should make it?

I agree.  On tmtest it's now the same as about 70% in the left column for clinched.  Looks pretty close to the map color.
Title: Re: HB: traveler mileage and percent
Post by: michih on December 21, 2017, 04:32:39 pm
Yep, looks much better:

http://tmtest.teresco.org/hb/index.php?u=michih&r=deubw.b028 (+)
http://tm.teresco.org/hb/index.php?u=michih&r=deubw.b028 (-)
Title: Re: HB: traveler mileage and percent
Post by: Duke87 on December 21, 2017, 06:33:25 pm
I did like the CHM scheme but then blue is my favorite color so I'm biased.

An obvious alternative, given the subject matter here, would be to use the ROYG range of the spectrum for fading. Something like

(EDIT: ok this works better as an image)
(https://i.imgur.com/aYcaLXA.png)

Colors I used are #800000, #a02000, #c04000, #e06000, #ff8000, #ffaa00, #ffd400, #ffff00, #c0e000, #80c000, #40a000, #008000
Title: Re: HB: traveler mileage and percent
Post by: michih on December 22, 2017, 03:15:59 am
I like it as-is now.
Title: Re: HB: traveler mileage and percent
Post by: rickmastfan67 on December 24, 2017, 05:10:53 am
How about adding some way for people to know which points they have marked as the start/end in their list files?

Case in point: http://tm.teresco.org/hb/?units=miles&u=rickmastfan67&r=wv.wv020
I have it traveled between US-60 & WV-39.  While all the labels between 'US60_E' & 'OdeTownRd' are colored, the 'WV39_W' point is not.  Maybe at least add a different color for that 'last' point showing that you have it clinched to it at least?  The way it looks now makes you think you only have it clinched to 'OdeTownRd' instead.  Maybe try coloring the 'WV39_W' style point as 'yellow'?
Title: Re: HB: traveler mileage and percent
Post by: michih on December 24, 2017, 09:13:50 am
The problem is that we mix two things. Waypoints and segments between two waypoints...
Title: Re: HB: traveler mileage and percent
Post by: yakra on December 24, 2017, 01:14:03 pm
I like michih's same-color-as-the-previous-line idea upthread
Title: Re: HB: traveler mileage and percent
Post by: Eth on December 24, 2017, 03:47:41 pm
The problem is that we mix two things. Waypoints and segments between two waypoints...

What if the segments in the table were offset so that they actually did appear as being between the points? Something like this, maybe?

(http://ten93.com/2017/tm_hb_concept.png)
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 24, 2017, 09:46:24 pm
The problem is that we mix two things. Waypoints and segments between two waypoints...

What if the segments in the table were offset so that they actually did appear as being between the points? Something like this, maybe?

(http://ten93.com/2017/tm_hb_concept.png)

My thought from upthread is almost this.  Just a matter of figuring out how to get an HTML table to do that.  I haven't looked into it at all yet.  Maybe there's an easy way.

Edit: a quick search suggests that something like this might be better accomplished without a table at all.  The harder part is the highlighting of waypoint labels, since I'd want them also to be highlighted or not based on segments not waypoints.

Further edit note to self: think about 2 tables one column each and shift the segment one down half a cell height.  For the traveler highlighting of waypoints on the left, check out the background-image CSS with a gradient.
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 24, 2017, 10:52:46 pm
Not too bad.  Here's a quick proof of concept:

http://tm.teresco.org/tabletest.html (http://tm.teresco.org/tabletest.html)

Of course, I'd match the TM style if there's some agreement that this would be an improvement.  There are two options - interested to hear which people like better and if this kind of change it worthwhile at all.

Title: Re: HB: traveler mileage and percent
Post by: michih on December 25, 2017, 02:43:38 am
I think option 2 looks a little bit better than option 1 but I'm not sure if works with any kind of browser or graphics card!?
Option 2 looks more "modern"...
Title: Re: HB: traveler mileage and percent
Post by: Eth on December 25, 2017, 12:47:29 pm
I think option 2 looks a little bit better than option 1 but I'm not sure if works with any kind of browser or graphics card!?

From what I can tell (https://caniuse.com/#search=linear-gradient), it should be fine unless you're still on IE9 or an older phone (iOS 6 or older, Android Jelly Bean or older).
Title: Re: HB: traveler mileage and percent
Post by: mapcat on December 25, 2017, 03:31:30 pm
I think option 1 would make it easier to spot missing single segments.
Title: Re: HB: traveler mileage and percent
Post by: vdeane on December 25, 2017, 05:34:31 pm
I prefer option 2.  It's hard to read the point labels on option 1.
Title: Re: HB: traveler mileage and percent
Post by: Jim on December 25, 2017, 07:47:35 pm
There's now an option 3 that's part way in between options 1 and 2.

Edit: and also now using the TM table style as used in the HB's waypoint lists.
Title: Re: HB: traveler mileage and percent
Post by: michih on December 26, 2017, 02:34:39 am
yep, option 3 looks fine.

I think there's still an issue left: How does a "normal" user identify that the color in the left column is his data and the color in the right column represents all users driven the route?
Title: Re: HB: traveler mileage and percent
Post by: mapcat on December 27, 2017, 11:49:25 pm
Option 3 works for me too.
Title: Re: HB: traveler mileage and percent
Post by: rickmastfan67 on December 28, 2017, 12:26:36 am
3 looks like it should work as well IMO.
Title: Re: HB: traveler mileage and percent
Post by: yakra on December 28, 2017, 02:30:16 am
Was there another thread here, or perhaps a GitHub issue, regarding incorrect %ages being shown in the HB?
I'm too lazy -- I mean, preoccupied, to search for one ATM.
Title: Re: HB: traveler mileage and percent
Post by: michih on December 28, 2017, 03:49:09 am
Was there another thread here, or perhaps a GitHub issue, regarding incorrect %ages being shown in the HB?

https://github.com/TravelMapping/Web/issues/103
Title: Re: HB: traveler mileage and percent
Post by: vdeane on December 30, 2017, 04:24:36 pm
I also like option 3.
Title: Re: HB: traveler mileage and percent
Post by: mvak36 on January 03, 2018, 04:06:12 pm
http://tmtest.teresco.org/hb/?units=miles&u=mvak36&r=mo.us065

I found a minor thing. It might be correct already but I'm not sure. I got to the waypoints for I-44 and US50 on US65, but they are not highlighted red in the column on the left.
Title: Re: HB: traveler mileage and percent
Post by: Jim on January 03, 2018, 04:25:43 pm
http://tmtest.teresco.org/hb/?units=miles&u=mvak36&r=mo.us065

I found a minor thing. It might be correct already but I'm not sure. I got to the waypoints for I-44 and US50 on US65, but they are not highlighted red in the column on the left.

As it is currently implemented, the clinched segments are indicated only by the first waypoint endpoint.  If I implement one of the new options, hopefully things would become more clear.