-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DataGridPremium] Support aggregating data from multiple row fields #6656
Conversation
These are the results for the performance tests:
|
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 think it's worth taking a look at what AG-Grid is doing
https://www.ag-grid.com/javascript-data-grid/aggregation-custom-functions/#custom-full-row-aggregation
@@ -58,6 +65,13 @@ export interface GridAggregationFunction<V = any, AV = V, FAV = AV> { | |||
* @default `true` | |||
*/ | |||
hasCellUnit?: boolean; | |||
/** | |||
* Function that allows to redefine the value of the cells used to generate the aggregated value. | |||
* Useful for multi-column aggregation when aggregated value is generated from multiple columns. |
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 would avoid to call this "multi-column aggregation", it took me some time to understand that it was one column with aggregated value depending on other columns not just the data of the current column.
For me "multi-column aggregation" is just having two or more items in the aggregation model (like multi filtering or multi sorting)
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 about something like this?
Screen.Recording.-.Made.with.FlexClip.1.webm
Demo : https://codesandbox.io/s/wonderful-david-px9cjr?file=/demo.tsx
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.
For me "multi-column aggregation" is just having two or more items in the aggregation model (like multi filtering or multi sorting)
Yeah, I see the confusion here. Especially because in the demo I've added in this PR there are multiple columns aggregated as well 🙃
Maybe title it as "Aggregating value from multiple fields of the rows"? What do you think?
I think it's worth taking a look at what AG-Grid is doing
https://www.ag-grid.com/javascript-data-grid/aggregation-custom-functions/#custom-full-row-aggregation
Hmm, I don't think I understand the relation to this PR.
What I do in this PR is covered in AG Grid here: https://www.ag-grid.com/javascript-data-grid/aggregation-custom-functions/#multi-column-aggregation
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 about something like this?
Screen.Recording.-.Made.with.FlexClip.1.webm
Demo : codesandbox.io/s/wonderful-david-px9cjr?file=/demo.tsx
Hey @yaredtsy
Could you explain what problem you are addressing in this demo?
This doesn't seem to be related to aggregation, but maybe I'm missing something?
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.
Maybe title it as "Aggregating value from multiple fields of the rows"? What do you think?
Fine for me !
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.
Hey @cherniavskii
I was looking at the AGgrid implementation and they support string formulas for valueGetter
like 'a+b'. and I thought this would be a nice feature if it was implemented. It can also be extended for users to do the computation to add or update columns from the UI like excel. i might be off topic
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 was looking at the AGgrid implementation and they support string formulas for valueGetter like 'a+b'
Yes, but it doesn't seem to be related to aggregation though.
We can discuss this in a separate issue if the community requests this.
006d437
to
ba7ee38
Compare
@m4theushw @DanailH @flaviendelangle Is this likely to make it into the next weekly release? |
Any update on getting this into the main build? |
Closes #6418
Preview: https://deploy-preview-6656--material-ui-x.netlify.app/x/react-data-grid/aggregation/#aggregating-data-from-multiple-row-fields
TODO:
master
branch [DataGridPremium] Support aggregating data from multiple row fields #6844