Compass sorts according to consensus_weights and then displaysthe top results. So the tablesorter sorts on top of the already sorteddata which isn't what we want. You might want to look at:https://github.com/gsathya/compass/blob/master/compass.py#L303One approach would be to send all the data unsorted and make thejavascript do all the sorting and display only the top results asspecified. This means that if someone wants to see only the top 10results, they'd have to download all the data which is not a goodidea.The other approach would be to modify compass.py to do the varioussorting stuff. This means we'd have to refresh the page every time theuser selects a different header to sort by. The advantage of thisapproach would be that the command line part of Compass would get allthese benefits as well. IMHO, this approach sounds better.
Copy pasting conversation between cwacek and me, in case it's useful to someone else.
I rewrote portions of compass.py so that it now does the sorting stuff. This means that sorting is now possible from the command line.
In addition, I AJAX-ified the front-end using AngularJS, so now all requests are made asynchronously, and the table can be sorted by clicking on the table headers.
I tried out the new CLI version, and everything looks good there. But how would I deploy the new web version? When I git checkout your branch and restart Apache, I can load the Compass page, but it says "No module: Compass" in http://localhost/static/js/angular/angular.js in the error console. What did I miss?
Thanks a lot for the changes! This is a pretty big merge which changes a lot of things and I'm still only halfway through reviewing this. I wanted to hold of commenting on this until I finished the review, but I'd like to sort out a few things before we proceed.
The URL's no longer change (it's not bookmark-able -- you can't share it). Is this ok? I distinctly remember arma wanting this in the beginning.
Why use angular.js if the sorting is going to be done by the backend?
When grouping by country, the fingerprint column only says "(XXX rel)" (should be "XXX relays") and remains a hyperlink.
I tried out the new CLI version, and everything looks good there. But how would I deploy the new web version? When I git checkout your branch and restart Apache, I can load the Compass page, but it says "No module: Compass" in http://localhost/static/js/angular/angular.js in the error console. What did I miss?
I tested using the built in server, but not Apache so I'm not sure. I'll set up an Apache instance and test it there to see what's wrong.
Thanks a lot for the changes! This is a pretty big merge which changes a lot of things and I'm still only halfway through reviewing this. I wanted to hold of commenting on this until I finished the review, but I'd like to sort out a few things before we proceed.
The URL's no longer change (it's not bookmark-able -- you can't share it). Is this ok? I distinctly remember arma wanting this in the beginning.
Ah, I was not there in the beginning so I didn't know this. However, I think that this is a solvable problem (and this ties into your next question), because I can make Angular make sure the urls are bookmarkable. I'll take a look and see if this can be done.
Why use angular.js if the sorting is going to be done by the backend?
Angular handles the AJAX callbacks very nicely in terms of updating the data displayed. It also might make addressing your first point very easy.
When grouping by country, the fingerprint column only says "(XXX rel)" (should be "XXX relays") and remains a hyperlink.
Thanks a lot for the changes! This is a pretty big merge which changes a lot of things and I'm still only halfway through reviewing this. I wanted to hold of commenting on this until I finished the review, but I'd like to sort out a few things before we proceed.
The URL's no longer change (it's not bookmark-able -- you can't share it). Is this ok? I distinctly remember arma wanting this in the beginning.
Ah, I was not there in the beginning so I didn't know this. However, I think that this is a solvable problem (and this ties into your next question), because I can make Angular make sure the urls are bookmarkable. I'll take a look and see if this can be done.
Why use angular.js if the sorting is going to be done by the backend?
Angular handles the AJAX callbacks very nicely in terms of updating the data displayed. It also might make addressing your first point very easy.
When grouping by country, the fingerprint column only says "(XXX rel)" (should be "XXX relays") and remains a hyperlink.
Ack I'll fix that.
I've pushed a couple changes that address the points you've raised gsathya. URLs now map to the queries that are made, allowing one to 'save' or bookmark searches. I also fixed the handling of the FP field when grouping by country.
I've pushed a couple changes that address the points you've raised gsathya. URLs now map to the queries that are made, allowing one to 'save' or bookmark searches. I also fixed the handling of the FP field when grouping by country.
Great, thanks! I just tested it and it's fine :)
I'll wait until Karsten ACK's this and then merge it. (changing it to needs_review)
Merged and deployed. Thanks! (gsathya, given that you already reviewed the code, I figured it's easier to just merge it instead of ACK'ing and waiting for you to do it.)
Is there a way to make it more obvious that columns can now be sorted?