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

Optimize loading of Tree children #5720

Open
avkolomeets opened this issue Nov 9, 2022 · 2 comments
Open

Optimize loading of Tree children #5720

avkolomeets opened this issue Nov 9, 2022 · 2 comments
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. enhancement Issues tied to a new feature or request.
Milestone

Comments

@avkolomeets
Copy link

avkolomeets commented Nov 9, 2022

Description

I'm trying to use the calcite-tree component in Data Browser in the BA Web app. The problem is that, while browsing for variables coming from the server, sometimes we need to show a long list of items. There can be up to 10,000 items total, grouped by categories. Right now it takes about 10 seconds to build a list like the one below, which makes it unusable.

image

How this can be optimized:

(1) Delay the creation of hidden children in the collapsed nodes. No need to create them all at once. The problem with Calcite in general is that it gets created from already added HTML tags, which then get hydrated. Maybe there is a work-around for that right now.

(2) The approach dgrid uses https://dgrid.io which is to display only the items in the view. As you scroll down, elements that are out of sight get removed and new ones are created. This allows for a very lightweight output, as only a few HTML elements are present in the list at the moment.

Acceptance Criteria

calcite-tree must work faster.

Relevant Info

No response

Which Component

https://developers.arcgis.com/calcite-design-system/components/tree/

Example Use Case

No response

Esri team

ArcGIS Business/Community Analyst

@avkolomeets avkolomeets added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Nov 9, 2022
@avkolomeets
Copy link
Author

avkolomeets commented Nov 14, 2022

@jcfranco Added a codepen sample.

https://codepen.io/cont-kolomeets/pen/jOKwVMG?editors=1000

It's an extreme example, but shows the problem. The first node has 5000 children, but the user doesn't have to wait for 14 seconds for the whole tree to load, because those children are not visible.
Also with so many HTML elements loaded at once, the whole page starts lagging.

image

As mentioned above, in our own implementation of a tree in Data Browser we render only visible HTML elements and destroy those that get out of sight as you scroll, which makes it super fast and can render a tree with 1,000,000 items total, each row having complex content (checkbox, actions, ect.).

@geospatialem geospatialem added the blocked This issue is blocked by another issue. label Jan 22, 2024
@geospatialem geospatialem added this to the Stalled milestone Jan 22, 2024
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Jan 22, 2024
@geospatialem
Copy link
Member

Blocked by the virtualization effort in #7384.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. blocked This issue is blocked by another issue. enhancement Issues tied to a new feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants