Skip to content
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 (not publicly released) #4208

Merged
merged 612 commits into from
Jul 18, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Mar 16, 2022

Closes #213

Doc preview

Extracted PRs

#4216
#4359
#4378
#4896

Works

  • Model

    • Controlled model
    • Initialized model
    • Import / export model
  • Rows

    • Add footer rows on each group when needed
    • Add top level footer row when needed
    • Do not count the footers in the total row displayed in the grid footer
  • Columns

    • Wrap the column properties that need to behave differently on aggregated cells
  • Rendering

    • Define custom valueFormatter on the aggregation function
    • Be able to render differently aggregated values with and without cell units
  • Add one select per available position in the column menu

Aggregation in the row flow chart

The chart below shows that the aggregation is triggered between the sorting and the filtering.

graph TD
    PropsRows(Update props.rows) --no throttling--> GroupRows
    UpdateRows(Call apiRef.current.updateRows) --throttling--> GroupRows

    SetRowChildrenExpansion(Call apiRef.current.setRowChildrenExpansion) --> FilteringWithoutSorting

    GroupRows["Group rows<br />(tree data, row grouping or flat tree)"] --> HydrateRows
    HydrateRows[Hydrate rows<br />eg: add aggregation footer] --> FilteringWithSorting

    FilteringWithoutSorting[Apply filters] --> Rendering

    FilteringWithSorting[Apply filters] --> Sorting
    Sorting[Apply sorting] --> Rendering

    FilteringWithSorting -.-> Aggregation
    Aggregation[Apply aggregation] -.-> Sorting

    Rendering[Render new rows]
Loading

@flaviendelangle flaviendelangle added component: data grid This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user labels Mar 16, 2022
@flaviendelangle flaviendelangle self-assigned this Mar 16, 2022
@mui-bot
Copy link

mui-bot commented Mar 16, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 251.8 654.8 384.1 432.82 163.13
Sort 100k rows ms 459.8 914.9 798.4 767.76 164.684
Select 100k rows ms 189 338.2 285.7 279.7 49.731
Deselect 100k rows ms 126.7 278.4 253.1 222.92 55.159

Generated by 🚫 dangerJS against cbbc54c

@flaviendelangle flaviendelangle added the on hold There is a blocker, we need to wait label Mar 17, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 17, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 17, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 18, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 18, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 18, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 22, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 24, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 29, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 30, 2022
@flaviendelangle
Copy link
Member Author

Following a discussion with @oliviertassinari
I prefixed all the aggregation apis (state / props / api method / column property) with private_ and I moved the doc to aggregation-next to keep it private for now.

That way, we can merge the feature in its current shape to ease the review of the row pinning when ready.

@flaviendelangle flaviendelangle force-pushed the aggregation branch 7 times, most recently from c613d74 to 9cbee1f Compare July 8, 2022 08:44
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 8, 2022
@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 11, 2022
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 12, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 13, 2022
@gerdadesign
Copy link
Member

Users can create there own. On the doc I gave an example with the first and last in the alphabetical order.
Not sure what's the maximum label size we should support correctly.
But probably more than 4-5 letters.

Seems like the label could be there, but truncate when resizing the column? In Figma, I had some exploration around the way the labels are displayed when sorting, filtering, etc is applied as well. There could be a benefit of a tidier header if we condense the visual indicators of applied actions, but we lose the clarity at a glance.

HeaderOptions

@flaviendelangle flaviendelangle merged commit d20e5d6 into mui:master Jul 18, 2022
@flaviendelangle flaviendelangle changed the title [data grid] Implement Aggregation [data grid] Implement Aggregation (not publicly released) Jul 18, 2022
@flaviendelangle flaviendelangle mentioned this pull request Jul 21, 2022
@kittyvandergijp
Copy link

We are looking to use this feature. When will this be publicly available?

@cherniavskii
Copy link
Member

@kittyvandergijp after #5592 is merged, likely in the next release

alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
@flaviendelangle flaviendelangle deleted the aggregation branch November 18, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Implement Aggregation
9 participants