New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying default sort columns for tables #1667
Conversation
Difficult to maintain, how come? To me this seems much easier to maintain for users. Columns could come and go quite easily with MultiQC versions / new tool support / tweaks in analysis etc. Column IDs should be fairly stable. I think I use column IDs for some other stuff already. I have a feeling that they're printed in the configuration modal in the report front end (where you show and hide columns). |
Squash of MultiQC#1667
Squash of MultiQC#1667
Awesome stuff. Referencing columns by titles is user-friendly, but I'd allow referencing by IDs as well, like it's done by default in other configuration sections like table_columns_visible. I'll try to do that, and will merge with master as well :) |
Yup, IDs is better than names I think. Just position index that I wasn't keen on. |
Minor changes - I also allowed to omit the "order" as it defaults to "desc" anyway, and added a docs example of sorting general stats. Looks great! |
#1666 upgrades the tablesorter plugin. The new version of tablesorter allows you to specify a default sort order via
data-
html attribute.This PR extends that to thread a
defaultsort
option through per-table configs and actually do the default sorting.Here is an example config:
This specifies to sort:
I am soliciting feedback on the interface. I see two options here:
tablesorter
spec - it's a 1:1 passthrough. However, this means re-ordering the columns or adding/removing could change the defaultsort behaviour.table.py
, it seems we only have the header IDs, and not necessarily the names (they're buried in pre-assembled html content). Therefore I think the implementation of this approach would be quite messy and difficult to maintain.The first seemed much simpler to me.
Once we get consensus, happy to update the docs!
CHANGELOG.md
has been updated[UPD by Vlad on 21 Nov 23]: final implementation below. Col IDs and titles are accepted here.