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] Lazy load data with virtualization #1247

Closed
1 task done
DanailH opened this issue Mar 17, 2021 · 10 comments
Closed
1 task done

[data grid] Lazy load data with virtualization #1247

DanailH opened this issue Mar 17, 2021 · 10 comments
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request plan: Pro Impact at least one Pro user priority: important This change can make a difference RFC Request For Comments

Comments

@DanailH
Copy link
Member

DanailH commented Mar 17, 2021

Make lazy loader work together with the rowCount prop.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

In order for the lazy loader feature to be complete, we need to make it work in combination with the rowCount prop. This means that a developer can set the total number of rows beforehand. The grid will then allocate space for all the rows and size this scrollbar correctly.

The loadRows callback will be called requestion the rows within an area of [a, y] with the right sorting, filtering, etc. parameters and load them in their appropriate place.

Examples 🌈

<DataGridPro
  rows={[]}
  rowCount={500}
  loadRows={handleLoadRows}
/>

Motivation 🔦

Allow products that would benefit from fewer pages for UX reasons to have pages of up to 100,000 rows.

#2038 is a step in this direction. It allows developers knowing what are the currently visible rows in the viewport.

Benchmark

@DanailH DanailH added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 17, 2021
@oliviertassinari oliviertassinari added components: XGrid new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 17, 2021
@oliviertassinari oliviertassinari changed the title [DataGrid] Make infinite loader support rowCount [XGrid] Make infinite loader support rowCount Mar 17, 2021
@oliviertassinari oliviertassinari added the priority: important This change can make a difference label Mar 18, 2021
@DanailH DanailH self-assigned this May 17, 2021
@sebastianfrey
Copy link
Contributor

Any plans when this feature will be released?

@oliviertassinari
Copy link
Member

Any plans when this feature will be released?

@sebastianfrey Unclear, but we would love to hear more about the problem you wish to solve with this feature. Could you expand? :)

@sebastianfrey
Copy link
Contributor

sebastianfrey commented Jun 28, 2021

@oliviertassinari Sure :).

I use the grid in a currently new developed GIS application to visualize the attributes of various heterogeneous spatial data sources with support for paginated queries. The amount of data this sources have stored goes from a few hundred records to a few hundred thousand and somtimes up to a million or more.

So while having a few hundered to thousand records the current approach by just loading the next batch of rows when the user reaches the bottom end of the scroll area is acceptable. With an increasing amount of records this becomes unwieldy.

Sure users can always filter the records by attributes or spatial conditions, but since in the current version of our application, the here proposed feature is already supported and there are likely some users, which will miss that feature, it would be nice, to have this feature supported by XGrid as well.

FYI:

In the current version of our GIS application we use the Dojo Toolkit library dgrid in conjunction with a custom dstore implementation for data fetching.

@erwelch
Copy link

erwelch commented Jul 1, 2021

I'd like to see this land as well. We have a lot of tables in our application and are using graphql w/relay as our data client. Relay's pagination appends the loaded data, so infinite scroll tends to be more favorable with our queries over traditional pagination. When the grid displays the total # of rows as a different number than the true # of records it is a confusing user experience. Would love to display the total count so users aren't guessing how far they can scroll until they reach the end of the list.

@oliviertassinari

This comment has been minimized.

@oliviertassinari oliviertassinari modified the milestones: Sprint 20, Sprint 21 Aug 16, 2021
@oliviertassinari oliviertassinari changed the title [XGrid] Make infinite loader support rowCount [DataGridPro] Make infinite loader support rowCount Aug 30, 2021
@oliviertassinari oliviertassinari added the plan: Pro Impact at least one Pro user label Dec 5, 2021
@oliviertassinari oliviertassinari changed the title [DataGridPro] Make infinite loader support rowCount [DataGridPro] Lazy load dataset Dec 28, 2021
@oliviertassinari oliviertassinari changed the title [DataGridPro] Lazy load dataset [DataGridPro] Lazy load data with virtualization Dec 28, 2021
@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Dec 28, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 26, 2022

Interesting feedback in https://mui.zendesk.com/agent/tickets/2164. AWS Lambda limits the payload of responses to 6 MB, so typically, developers can't fetch more than ~1,000 rows per request. I would argue that they don't want to fetch more than 100 rows in practice, that they should lazy load the rest as the end-user scrolls the page.

When using the data grid for internal apps, I would expect it to be frequent to have millions of records. So I assume that these people have to 1. enable pages of about 1,000 rows or 2. use the infinite loading feature: https://mui.com/components/data-grid/rows/#infinite-loading but when you know the exact number of records and you can fetch the rows on-demand, it's not great (crippled scroll, no pagination)

@oliviertassinari oliviertassinari changed the title [DataGridPro] Lazy load data with virtualization [data grid] Lazy load data with virtualization Mar 29, 2022
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 1, 2022

I have found https://glideapps.github.io/glide-data-grid/?path=/story/glide-data-grid-dataeditor-demos--server-side-data that could be a great source of inspiration for the solution. The source of the demo. For example, it relies on the onVisibleRegionChanged prop to implement the lazy data fetching. I assume it the same concept that AG Grid uses internally for https://ag-grid.com/javascript-data-grid/viewport/.

What's the plan for this issue? I assume that we need to move carefully, the problem is complex, and has a lot of interdependencies. I assume that this issue is only the tip of the iceberg. Should we start with the high-level RFC on the whole picture, with each step along the way?

@oliviertassinari oliviertassinari added the RFC Request For Comments label Aug 12, 2022
@joserodolfofreitas joserodolfofreitas added RFC Request For Comments and removed RFC Request For Comments labels Sep 8, 2022
@DanailH
Copy link
Member Author

DanailH commented Oct 11, 2022

Should we close this one? The PR linked adds that functionality.

@DanailH DanailH closed this as completed Oct 11, 2022
@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 7, 2022

@DanailH
Copy link
Member Author

DanailH commented Dec 13, 2022

@oliviertassinari this is the one that makes the most sense to be picked up #3377. @MBilalShafi has expressed some interest to check it but we can start thinking about this once we have the beta for v6 out.

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! new feature New feature or request plan: Pro Impact at least one Pro user priority: important This change can make a difference RFC Request For Comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants