Travel Mapping

Web Design Discussion => General Web Design Discussion => Topic started by: Jim on May 31, 2020, 10:38:22 pm

Title: Top Stats on tmtest
Post by: Jim on May 31, 2020, 10:38:22 pm
Early work on a "Top Stats" page, similar to what used to exist on CHM, is now on tmtest.

Go to http://tmtest.teresco.org/user/topstats.php to see what's there so far.  I hope to have time on Monday to add more.  I don't promise I won't be breaking it as I add features.  I'm focused mostly on getting the stats on the page for now, haven't thought much about presentation yet (so it's ugly).
Title: Re: Top Stats on tmtest
Post by: mapcat on May 31, 2020, 11:18:47 pm
Thanks for working on this! I like what you've done with it so far.

A few ideas:
Is there a limit to the max entries per table?
Title: Re: Top Stats on tmtest
Post by: yakra on June 01, 2020, 12:47:14 am
Clicking on "US2 (New York - Maine)" takes me here (http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&rte=US2).
It's appropriate with the features currently available, but a way to view connected routes in mapview (https://github.com/TravelMapping/Web/issues/101#issuecomment-532468624) would be good.
I had a go at waypoints.js.php back in November, but didn't get too far with it; a lot of moving parts to wrap my head around.
That file undergirds the HB too, so once the right changes are in place, we're most of the way to having ConnectedRoutes in the HB (https://github.com/TravelMapping/Web/issues/421), yes?
Title: Re: Top Stats on tmtest
Post by: Jim on June 01, 2020, 08:25:39 am
Cut off the tables when there aren't enough routes to fill them. I selected Alberta, and kept the default 25 entries, and my "most traveled" table had the 20 I had traveled plus 5 random ones with 0 miles. The clinched route table showed only the routes I'd clinched, so that one worked.

Just fixed it.

Quote
Include only connected routes that exist in the selected region. My Alberta tables had interstates and US highways on them. I see the disclaimer next to the region drop-down in the table, so you know about this, but even with the disclaimer, I don't understand why these are showing on every page. Maybe the user should have to choose between region and connected routes?

I think ultimately, I'll have the option as you mention to think about connected routes or in-region only.

Quote
The CHM tables included one that showed the non-clinched routes with the shortest missing mileage, which would be helpful for identifying segments that users may have forgotten to enter, or would want to go back to finish off.

Definitely on my list.

Quote
Is there a limit to the max entries per table?

Currently set to 500 but other than the fact that the tables would be huge, there's no reason I couldn't make it larger.
Title: Re: Top Stats on tmtest
Post by: Jim on June 01, 2020, 08:28:37 am
Clicking on "US2 (New York - Maine)" takes me here (http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&rte=US2).
It's appropriate with the features currently available, but a way to view connected routes in mapview (https://github.com/TravelMapping/Web/issues/101#issuecomment-532468624) would be good.
I had a go at waypoints.js.php back in November, but didn't get too far with it; a lot of moving parts to wrap my head around.
That file undergirds the HB too, so once the right changes are in place, we're most of the way to having ConnectedRoutes in the HB (https://github.com/TravelMapping/Web/issues/421), yes?

waypoints.js.php was modeled after CHM's mechanism for getting DB info.  Scrollable Mapview and this page don't use it.  I think it's OK for the HB, but wasn't a good choice for original Mapview, parts of HDX, and some other things that use it.  It's been mangled to handle lots of cases for which the model it uses is not great.  I'm hoping to move more code away from waypoints.js.php and into AJAX calls to query the DB on demand.
Title: Re: Top Stats on tmtest
Post by: Jim on June 01, 2020, 12:11:27 pm
It also occurs to me that there should be options here to choose active only, active+preview, or maybe even include devel (though I hesitate to do the last as it risks encouraging people to start plotting devel routes even before they go from devel to preview, a step that usually happens pretty quickly).
Title: Re: Top Stats on tmtest
Post by: michih on June 01, 2020, 12:45:24 pm
Please don't include devel routes!

Since we distinguish between active and active+preview all over the user pages, we should do the same here.

(I don't like the general policy but we should be consistent)
Title: Re: Top Stats on tmtest
Post by: Jim on June 01, 2020, 05:06:24 pm
Various improvements plus "closest to clinched" tables are up.  Keep letting me know if you see anything broken.
Title: Re: Top Stats on tmtest
Post by: mapcat on June 01, 2020, 07:13:23 pm
Changing the username in the options box correctly delivers stat tables for that user, but doesn't change the username in the URL. So when you select a route from one of the tables, you will get a map for a different user.
Title: Re: Top Stats on tmtest
Post by: ntallyn on June 01, 2020, 09:04:54 pm
I took a look at my stats, and went looking for the missing 0.54 miles of I-526, so I clicked on the route.

The system displayed I-526, I-526BS, and FutI-26 all on the map viewer (which is fine), but connected the ends of the routes with each other. So there's an extraneous segment from the west end of I-526 to the south end of I-526BS, and another one from the north end of I-526BS to the west end of FutI-526.

Incidentally, that only happens when the username (u=ntallyn) is not specified in the URL. Once I added that, I saw the map that I expected.
Title: Re: Top Stats on tmtest
Post by: Jim on June 02, 2020, 08:39:46 am
A few thoughts and questions on this.

- I am not planning to reproduce lists you can find on other pages like regions and systems ranked by travels (on the main user stats page).

- Would it make more sense to put the functionality currently in topstats.php right onto the user stats pages, or keep it on a separate page?  I'm thinking to keep it separate but with a link to it from the user stats page.

- I'd also like to have more stats based on all users of the project overall (and seem to recall CHM doing some of that), and opened an Issue for this: https://github.com/TravelMapping/Web/issues/452
Title: Re: Top Stats on tmtest
Post by: Jim on June 02, 2020, 10:45:50 am
Since this is independent of other parts of the site, I see no reason to keep it hidden over on tmtest.  It's merged into the master branch on GitHub and on the production site.  There's also a link at the top of the user stats page.

Please make report any lingering errors and make feature suggestions in new Issues or forum topics.
Title: Re: Top Stats on tmtest
Post by: michih on June 02, 2020, 11:04:15 am
Whatever I select, I never get any stats.

region is not selectable on start but later on.

Example:
1. http://travelmapping.net/user/topstats.php?units=km&u=michih
2. Select Andorra system
3. Press Update Stats
Title: Re: Top Stats on tmtest
Post by: Jim on June 02, 2020, 11:09:53 am
Whatever I select, I never get any stats.

region is not selectable on start but later on.

Example:
1. http://travelmapping.net/user/topstats.php?units=km&u=michih
2. Select Andorra system
3. Press Update Stats

Region is not selectable when you are using connected routes.  Switch to in-region and you can select a region.

When I do your example, I get stats.  Can anyone else reproduce michih's error?
Title: Re: Top Stats on tmtest
Post by: michih on June 02, 2020, 11:17:53 am
http://tmtest.teresco.org/user/topstats.php?units=km&u=michih works pretty fine! but not the production site.
Title: Re: Top Stats on tmtest
Post by: michih on June 02, 2020, 11:22:14 am
1. http://tmtest.teresco.org/user/topstats.php?units=km&u=michih
2. Click on E35 as no.1 of "longest clinched routes"
3. http://tmtest.teresco.org/user/mapview.php?units=km&u=michih&rte=E35 opens which includes Malaysia and Japan.

Should be:
http://tmtest.teresco.org/user/mapview.php?units=km&u=michih&rte=E35&sys=eure

It's this issue again: https://github.com/TravelMapping/Web/issues/101
Title: Re: Top Stats on tmtest
Post by: michih on June 02, 2020, 11:28:46 am
Just the very same. E35 to the eure system but you cannot see it in the table.
A7 and A3 are no. 2+3. I know that they must be the German routes but it's not displayed!
A14 is in Italy, A9 might be France or Germany. A6 could be the French, Spanish or German motorway. A89 is France for sure, the rest is wild guess...

I don't know how we should indicate it though. I guess it's no problem for USA and Canada....

edit: http://web.archive.org/web/20160315212851/http://cmap.m-plex.com/stat/topstats.php?u=aaroads#ltl
We had the system name in small font back then.
Title: Re: Top Stats on tmtest
Post by: Markkos1992 on June 02, 2020, 12:01:38 pm
I put Pennsylvania as the region, and for Most Traveled, US 30 (169 travelers) is below I-76 (163 travelers), should it be in the order of most traveled to least traveled?

Also is the Unclinched Traveled Routes Closest to Clinched Table based on the closest distance from the line of the unclinched route to a clinched route?

Title: Re: Top Stats on tmtest
Post by: michih on June 02, 2020, 12:08:28 pm
I put Pennsylvania as the region, and for Most Traveled, US 30 (169 travelers) is below I-76 (163 travelers)

Because YOU have clinched 464mi on US30 but 566mi on I-76!
Title: Re: Top Stats on tmtest
Post by: Markkos1992 on June 02, 2020, 12:47:39 pm
I put Pennsylvania as the region, and for Most Traveled, US 30 (169 travelers) is below I-76 (163 travelers)

Because YOU have clinched 464mi on US30 but 566mi on I-76!

I think I understand it better.  It is specific to our stats and not overall.  (same with the third table being distance not traveled on said route)

It would help to have a basic definition of what each table meant on the website somewhere.
Title: Re: Top Stats on tmtest
Post by: vdeane on June 02, 2020, 12:54:44 pm
There's a route on mine where "Québec" is displayed as "Québec".  Looking around more, this isn't the only page where this happens (displaying the Autoroutes system shows the error, but displaying the region shows it correctly), but it's where I noticed it.
Title: Re: Top Stats on tmtest
Post by: Jim on June 02, 2020, 01:34:39 pm
Right, topstats.php is for an individual user's travels.  The "closest to clinched" is the untraveled distance on routes where you have traveled but not clinched, intended to show "low hanging fruit" for those looking to add to their list of clinched routes.
Title: Re: Top Stats on tmtest
Post by: michih on June 26, 2020, 01:59:53 pm
1. http://tmtest.teresco.org/user/topstats.php?units=km&u=michih
2. Click on E35 as no.1 of "longest clinched routes"
3. http://tmtest.teresco.org/user/mapview.php?units=km&u=michih&rte=E35 opens which includes Malaysia and Japan.

Should be:
http://tmtest.teresco.org/user/mapview.php?units=km&u=michih&rte=E35&sys=eure

It's this issue again: https://github.com/TravelMapping/Web/issues/101
Just the very same. E35 to the eure system but you cannot see it in the table.
A7 and A3 are no. 2+3. I know that they must be the German routes but it's not displayed!
A14 is in Italy, A9 might be France or Germany. A6 could be the French, Spanish or German motorway. A89 is France for sure, the rest is wild guess...

I don't know how we should indicate it though. I guess it's no problem for USA and Canada....

edit: http://web.archive.org/web/20160315212851/http://cmap.m-plex.com/stat/topstats.php?u=aaroads#ltl
We had the system name in small font back then.

@Jim, do you think that this is directly related to Non-connected related routes - definition discussion (https://forum.travelmapping.net/index.php?topic=3700) and Routes vs. Connected Routes (https://forum.travelmapping.net/index.php?topic=3650) or should I open a new Github issue for Top Stats?

I wanted to check how it works now but just found a bug (https://github.com/TravelMapping/Web/issues/508).
Title: Re: Top Stats on tmtest
Post by: Jim on June 26, 2020, 03:00:11 pm
^^ does the quick fix I just put in address the issue?  That page should give you legitimate connected routes (regardless of any misaligned border errors).
Title: Re: Top Stats on tmtest
Post by: michih on June 26, 2020, 04:16:44 pm
yep, looks good now. I've opened a new issue for the system name I forgot earlier today: https://github.com/TravelMapping/Web/issues/509