-
Notifications
You must be signed in to change notification settings - Fork 426
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
feat: add sorting to pivot query #11464
Conversation
✅ Deploy Preview for peaceful-bassi-cbf284 canceled.
|
This only covers the |
Since the issue mentions work to |
@@ -47,6 56,11 @@ export type VizPivotLayoutOptions = { | |||
reference: string; | |||
}; | |||
|
|||
export type VizSortBy = { | |||
reference: string; | |||
type?: SortByType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the purpose of having this type here? Can we derive this from thereference
? i.e. if x.reference = sort.reference then x-sorted else y-sorted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is to know if we are sorting by axis
or bar heights
I was not sure if the reference was pointing to a different axis, in some cases this might be redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove it
@@ -2087,6 2093,12 @@ export class ProjectService extends BaseService { | |||
), | |||
]; | |||
|
|||
const orderBy: string = sortBy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The orderBy also needs to be applied to line 2106 where we compute the row_index
. This is only valid for a sort that matches the indexColumn
reference. Any other sorts could be ignored in the pivot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Before
Screencast.from.16-09-24.13.35.47.webm
After
Screencast.from.16-09-24.13.35.13.webm
]} | ||
onChange={(value) => { | ||
if (value) { | ||
const direction = value as SortByDirection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaoviana how do we type mantine form fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this will work:
onChange={(value: SortByDirection) => {
because data
is static
🎉 This PR is included in version 0.1261.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes: #11358
Description:
Screencast.from.09-09-24.09.59.10.webm
Reviewer actions