Caleydo/lineupjs

New hirearchical sorting strategy

katush opened this issue · 8 comments

The current hierarchical sorting strategy has proved to be confusing, so we agreed on a new approach:

  • Clicking on sorting button will toggle between three states - ascending, descending, and off
  • The sorting order = order of the clicking (opposite to current approach): 1. sorted column will be at the top of sorting hierarchy, the 2. sorted column will be second, etc.

Practical implications:

  • Turning off sorting for the column at the top of the hierarchy will remove it from the hierarchy, the second column in the hierarchy will become first
  • When no sorting is active, the items will have the default order from the file

@sgratzl, is there something that speaks against the approach described above? @anita-steiner, @thinkh and @alexsb also agree that this is the established and therefore also most intuitive way to address this issue.

what is the workflow to first sort by A (top level) and then change my mind and sort by B (top level), which is IMO a more common scenario than a hierarchy with multiple levels.

Cause I think such a standard task should also be included in the user study. Cause in the current approach Excel is a better in doing that.

yep, sorting by a single column in a sequential order (and don't care about the sorting hierarchy) is definitely the more common use case (probably >90%).

let's assume the following scenario. the user first wants to sort by column A and then by B (and does not care about A)

  1. sort column A -> results in A sorted
  2. sort column B -> results in A sorted 1st and B sorted 2nd
  3. to get rid of A as 1st sorting criteria, the user clicks twice on the sort icon of column A (twice because the first click will sort is in descending order and the second click will turn off sorting for A).

does that make sense to you?

so for a case that is 90% of the time, you need 2 extra steps in order to simplify a case that is just happening in 10% of the cases? and while it makes sense, does the normal user would expect it?

everyone we asked so far agreed that this is the established way that they would expect. I agree that it needs on more cluck, but the big advantage is that a user is able to understand it.

another possibility would be to make it even more explicit like excel does. clicking on the sort icon would show three options:

  1. sort asc
  2. sort desc
  3. turn off sorting

image

this solution still needs the extra click, but it is even more explicit.

suggestion:

the sort hierarchy is formally defined as a set of triples. A triplet consists of column, asc/desc, and the hierarchy level or (COL, ASC, LEVEL). so the sorting criteria is { (COL, ASC, LEVEL) } | col is unique and level is unique }

when clicking the sort icon in the context menu a popup dialog let you exactly specify this triplet:

Order: 
 * None
 * Asc
 * Desc
Level:
 1
Sort By: 
 * Max
 * Min
 * Mean

whereas level and sort by are disabled when None is selected. Duplicate level entries will replace existing one. So, if you specify twice the level 1, the second column wins and the first column is removed (not shifted!) { (A, ASC, 1) } + (B, ASC, 1) => { (B, ASC, 1) }

other operations:

  • { (A, ASC, 1) } + (B, ASC, 2) => { (A, ASC, 1), (B, ASC, 2) }
  • { (A, ASC, 1), (B, ASC, 2) } + (A, DESC, 1) => { (A, DESC, 1), (B, ASC, 2) }
  • { (A, DESC, 1), (B, ASC, 2) } - (A, DESC, 1) => { (B, ASC, 1) }

the icon is just shortcut operation depending on the current state: (current -> next)

  • None -> ASC, level = 1
  • ASC, level = X -> DESC, level = X
  • DESC, level = X -> None

Thus, clicking icon = like single sort criteria but with the context menu entry one can add and create more levels.

open

  • with which value should be the level in the context menu be initialized if it is not already a sort criteria?
    • variant a: level = 1 <- similar to icon
    • variant b: (max current level + 1) <- add as secondary level by default

@katush Can you please check if this works now as expected? Please close this issue if everything is fine.