Author Topic: New table sorting library  (Read 25230 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #15 on: June 02, 2022, 07:30:40 am »
At the top of the page, the stats page is not showing the color on distance traveled for me for active only now.

Fixed.

Quote
I am also getting an "out of memory" error whenever I try to use the route finder.  I want to think it was something on my end, but I am unsure.

Works for me, but I've only tested so far on one high-end MacBook Pro.  It's possible that we won't be able to use the sortable.js functionality on a table that starts with 90,000+ rows without overwhelming memory capabilities of many browsers.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3317
  • Last Login:Today at 07:22:32 am
Re: New table sorting library
« Reply #16 on: June 02, 2022, 07:39:05 am »
Maybe it is the 90,000 rows, but the current version on the main Travel Mapping site is still working fine for me....

It seems to happen in the tmstage version when I click in the route name search field or elsewhere.
« Last Edit: June 02, 2022, 07:51:44 am by Markkos1992 »

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #17 on: June 02, 2022, 10:28:39 am »
Maybe it is the 90,000 rows, but the current version on the main Travel Mapping site is still working fine for me....

It seems to happen in the tmstage version when I click in the route name search field or elsewhere.

I think it's the extra memory used when the sortable code is applied - it attached things to every row.  I could see this easily doubling or more the memory requirements in JS to store and deal with the sorting of the table compared to the version that didn't have this.  Remember that the current production version doesn't support sorting at all.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3317
  • Last Login:Today at 07:22:32 am
Re: New table sorting library
« Reply #18 on: June 02, 2022, 12:05:11 pm »
I guess it is best to go without sorting the Route Finder for now until we can find ways to reduce memory to do it.  We can already somewhat sort it beyond the route name anyway so it is not that huge of a deal to be able to sort the columns.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #19 on: June 02, 2022, 01:52:20 pm »
I've got a version of findroute on tmstage now that puts in a button you can use to enable column sorting.  I don't think it should have any memory (or other) resource utilization beyond what the production version has until you click that button to turn on the functionality.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3317
  • Last Login:Today at 07:22:32 am
Re: New table sorting library
« Reply #20 on: June 02, 2022, 02:01:33 pm »
Thank you.  The Route Finder on tmstage now works fine for me without sorting.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4879
  • Last Login:Today at 03:49:22 am
Re: New table sorting library
« Reply #21 on: June 02, 2022, 02:59:06 pm »
@Jim, have you changed anything in the last three hours? The user page tables are sorted by region and system name now. I'm quite sure that it was by clinched miles (region) and % clinched three hours ago - just as it should be!

I haven't, but I bet I need to specify an initial sorting that differs from the order that comes out of the DB in those cases.

The version on tmstage should now sort as it did before.

Is this the behavior we want?

I think so.

I am not sure why the by-region table sorts by distance traveled while the by-system sorts by % traveled.

I'm used to it and like it as-is. I don't wanna see this being changed.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4879
  • Last Login:Today at 03:49:22 am
Re: New table sorting library
« Reply #22 on: June 02, 2022, 03:06:39 pm »
I've got a version of findroute on tmstage now that puts in a button you can use to enable column sorting.  I don't think it should have any memory (or other) resource utilization beyond what the production version has until you click that button to turn on the functionality.

It doesn't run out of memory for me but it takes a lot of power (browser slows down) and it's not working correct nor is usable (sorting takes 3-15 seconds and I easily managed that sorting by tier was a total mess 2-2-2-3-3-3-3-2-2-2....). There is no added value (right now).

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #23 on: June 02, 2022, 08:58:54 pm »
I've installed the latest on the production server, including the button that turns on optional sorting for findroute.  I think everything else is as good as or better than it was before, and no one who doesn't want to use the sorting on findroute is forced to press the button to turn it on.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4879
  • Last Login:Today at 03:49:22 am
Re: New table sorting library
« Reply #24 on: June 03, 2022, 11:51:35 am »
It seems that HB systems are sorted by code instead of country (first) + tier (second) now. Since the country column is the first one, it starts with Netherlands, followed by Africa, Finland and Albania now.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #25 on: June 03, 2022, 03:47:28 pm »
It seems that HB systems are sorted by code instead of country (first) + tier (second) now. Since the country column is the first one, it starts with Netherlands, followed by Africa, Finland and Albania now.

Initial sort is now however it came out of the DB.  I can pretty easily make it sort the way it was before, if that's the preference.  I don't know how people tend to look at that list.  I always just search for the system code I am looking for.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4879
  • Last Login:Today at 03:49:22 am
Re: New table sorting library
« Reply #26 on: June 03, 2022, 03:57:01 pm »
It seems that HB systems are sorted by code instead of country (first) + tier (second) now. Since the country column is the first one, it starts with Netherlands, followed by Africa, Finland and Albania now.

Initial sort is now however it came out of the DB.  I can pretty easily make it sort the way it was before, if that's the preference.  I don't know how people tend to look at that list.  I always just search for the system code I am looking for.

I think we should keep it as-was because people are used to it. We can change it if there is any improvement but I don't see it. The system code is just a "TM internal code". Sure, old hands are used to the code but newbies don't. Newbies likely look for the country or region first.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #27 on: June 03, 2022, 04:55:41 pm »
While I'm in hb/index.php again, any thoughts on the current practice in the "Country" column that any country name longer than 15 characters is replaced by its 3-character code?

Offline si404

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2078
  • Last Login:Today at 04:20:11 am
Re: New table sorting library
« Reply #28 on: June 03, 2022, 05:39:27 pm »
While I'm in hb/index.php again, any thoughts on the current practice in the "Country" column that any country name longer than 15 characters is replaced by its 3-character code?
It's fine for USA, obviously. DRC is OK. But TTO, STP, etc are a bit "huh?".

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2860
  • Last Login:Yesterday at 10:35:27 pm
Re: New table sorting library
« Reply #29 on: June 03, 2022, 10:10:27 pm »
Now on tmstage is a version of hb/index.php that sorts by default first by country, then breaks ties with tier, then breaks ties with system name.  If no one notices any problems with that on Saturday, I'll install it on the main server.