-
Notifications
You must be signed in to change notification settings - Fork 204
Closed
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is neededFurther information is needed
Description
maybeGroup always sorts by the group key:
Lines 229 to 236 in 98cb553
| export function maybeGroup(I, X) { | |
| return X | |
| ? sort( | |
| grouper(I, (i) => X[i]), | |
| first | |
| ) | |
| : [[, I]]; | |
| } |
Maybe there should be a way to turn this off if you want to render the groups in input order? It’s confusing because if you set the sort option to null, you don’t get input order, you get ascending natural order, which is different from most other cases. (It makes sense with the bin transform, though.)
plot/src/transforms/group.d.ts
Lines 21 to 32 in 98cb553
| /** | |
| * How to order groups; if null (default), groups are returned in ascending | |
| * natural order along *x*, *y*, and *z* (or *fill* or *stroke*). Group order | |
| * affects draw order of overlapping marks, and may be useful with the stack | |
| * transform which defaults to input order. For example to place the smallest | |
| * group within each stack on the baseline: | |
| * | |
| * ```js | |
| * Plot.groupX({y: "count", sort: "count"}, {fill: "sex", x: "sport"}) | |
| * ``` | |
| */ | |
| sort?: T | null; |
jamalc
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is neededFurther information is needed