Rothamsted / knetminer

KnetMiner - webapp to search and visualize genome-scale knowledge graphs
https://knetminer.com
MIT License
25 stars 16 forks source link

Complete evidence table sorting server side #744

Closed Arnedeklerk closed 1 year ago

Arnedeklerk commented 1 year ago

Currently, the evidence table sorting is being handled on the client side. The performance of this can be improved by getting the initial sorting from the server, as per #727.

After the latter is completed, the client should skip the initial sorting. The code relies on the jquery/table sorter component to manage alternative sorting criteria selected by the user (ie, clicks on table headers), this is to be kept as-is.

A problem with table sorter is that it doesn't know when the data it receives are already sorted, so it doesn't draw the corresponding column header ticks to change the sort order.

Regarding this, we should try this SO solution, ie, write a helper like TableSorter.setInitialOrder ( columnIndex, isAscending = true ). Ideally, this would be a method of the table sorter object, if it's too difficult to make it that way, just name it like setInitialTableSorterOrder().

marco-brandizi commented 1 year ago

Server side completed here.

The client can use it by adding isSortedEvidenceTable=true to the /genome call.

As far as I can see, client changes are to be made in createEvidenceTable(), and are like:

Arnedeklerk commented 1 year ago

Closing. Please note that as of now, tables are rendered in chunks (refer to https://github.com/Rothamsted/knetminer/issues/734) and are no longer sortable by the user. The initial sort is determined by the backend and remains unchanged throughout. This approach was adopted to avoid the need for re-sorting the entire table after every user adjustment, which goes beyond the scope of the current view window.