-
-
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
[data grid] Implement Aggregation #213
Comments
loving grouping (far out yall are killing it with features), really looking forward to aggregation! |
UI decision for the label of the footer aggregationOther librariesTelerikThe label of the aggregation is rendered on each column Advantages:
Disadvantages:
AG-GridOn footer, we can only aggregate with sum, so we can put the label on the 1st column Solutions for our projectSide note: By "1st column", I mean a column where we decide to put the label of the footer. When row grouping is being used, it will be the on the grouping column(s), when the tree is flat, the user has to provide an explicit column field. Right now on #4208, I have implemented the solution A which seems great when only one column is being used, but does not scale well if a user is aggregating with "max" on a column and "min" on another for instance. For each couple of image below, the 1st one is "gross: max, year: max" and the 2nd one is "gross: max, year: min" Solution A: Always on 1st columnRender the label on the 1st column if all columns are using the same aggregation function Advantages
Disadvantages
Solution B: Always on data columnAdvantages
Disadvantages
Solution C: On 1st column if 1 aggregation function, on data column if severalAdvantages
Disadvantages
|
@mui/x if you can have a look when you have some time |
Great work summarizing the solutions, @flaviendelangle! I think Solution A alone is very limited, and the distance between the label and the aggregated value is potentially a usability issue. I'm up for Solution B as the default behavior. Regarding the layout impact of Solution B, is it not feasible to use column spanning (when available) to extend the footer column without impacting the whole grid? |
With which column would you span ? |
If feasible, I was thinking, as a basic rule of thumb, to always span to the left if the left column is available. |
From a non technical persipective: Or even something like this (no idea how we could align the value correctly by the way) Additionally, how would it behave when there is also column spanning created by the user ? I am honestly not a huge fan of playing with row spanning for this. |
You're right. Better to deal with the layout impact. edit: How about customizing the footer? Could the dev setup a custom footer with col spanning? |
He has access to the footer ID, so I guess he can use column spanning manually if he wants. But what would be the default behavior ? One of my 3 solutions or a 4th one ? |
My personal preference is option C |
Solution D: Always on the data column headerAdvantages
Disadvantages
|
What about a prop This would allow switching easily between solutions B and C by exporting a function for each solution. Otherwise, solution C seems to be the more flexible solution |
Based on https://experience.sap.com/fiori-design-web/analytical-table-alv/#aggregate I think we shouldn't add a default label on any column or header. IMO, displaying the aggregate value in bold is enough to discover that it means when using the most common aggregation functions (sum or count). Showing the value sometimes inside the column but other times in the first column may surprise users. This doesn't block us from adding a prop to customize the last row and also a demo showing how to do it. Although, if we do want to show a label, I would be in favor of an "i" icon, with a tooltip, to the left of each aggregate value, so option B+. |
For me the goal are
My proposal is close to what @m4theushw is proposing Where is the label rendered ?
What is the label content ?
Possible evolution in the future
|
This might cover the basic needs on the developer side. If we're going in this direction, I'd at least go for C (adding automatic labels if multiple aggregation functions are used). I believe Aggregation should be more driven towards the end-user than the developer (not meaning to block customization or anything like that). |
I don't follow you. If we put the label on the 1st column, we need to define what "1st column" means. About Solution A or Solution B (and there variants). Those are the two major directions we can take. I prefer A because I see how to improve it to feel the main gap in the future which is the label on multi aggregation.
But for B, I don't see how to fix the problems. For instance the fact that the column will have a be significantly larger when aggregation is used, I don't have any solution for it. |
It doesn't. But it serves no purpose for the end-user directly (that's what I mean).
We could try to verticalize it. |
I still don't understand I feel like the debate around this prop has nothing to do with the real discussion here.
If you mean, to put the label above (or below) the value, then again it's touching the layout |
Considering the goal of not neglecting the labels when using multiple aggregations:
In this sense |
For For you, when would an end user want to change the value set by the developer of the app ? For And you could imagine other variations instead of I am focusing here on the developer API, because once we have this API, we can build UIs for it (and give the ability to the developers to build there own if they have special needs). The problem of solution B is when you aggregate both inline and on footer with different functions. But maybe that's an interesting trade-off:
And we enforce that all model items must follow the same mode (no Or an even more drastic decision: We don't allow to aggregate on 2 locations of the same column. Because
|
Is there no way currently to inject values into the grouped rows? For example if I have the data to be displayed in the grouped row. |
The |
@flaviendelangle but is it possible to get actual values of children rows (in editable mode) ? Because from what I can understand, |
Once you have a row id, you can call |
can i see an example of this, now i want to apply it to my project @flaviendelangle |
@chiendang1709 the feature will be available in a few weeks, we need to finish #1251 first You have the doc page here |
Any update on when aggregation might drop? |
The aggregation is available as an unstable feature since v5.15.0 and as a stable feature since v6.0.0 |
Benchmark
The text was updated successfully, but these errors were encountered: