Skip to content

treeModel.expandAll() never returns, bogs down chrome completely with a large tree. #415

Open
@jdewell

Description

@jdewell

Hi,
I have been enjoying using angular-tree-component for my tree inplementation. I havent seen any problems until I tried to expandAll() on my tree. The call to treeModel.expandAll() never returns and completely bogs down chrome. My tree has about 30000 nodes in a 3 deep configuration - 500->3000->24000. I have turned on virtual scroll.
The tree component has no performance issues initially displaying the collapsed tree. It takes just a second or so. Also scrolling is performant. Unfortunately, the expandAll() crashes.

Here are my options:

/*
angular2-tree options
 */
private options: ITreeOptions = {
    displayField: "label",
    childrenField: "items",
    useVirtualScroll: true,
    nodeHeight: 22,
    allowDrop: (element, { parent, index }) => {
        this.dragEndItems = _.cloneDeep(this.items);
        if (parent.data.labName) {
            return false;
        } else {
            return true;
        }
    },

    allowDrag: (node) => node.isLeaf,
};

HTML:


<tree-root #tree (moveNode)="onMoveNode($event)"
(dragEnd)="onDragEnd1($event)"
(activate)="treeOnSelect($event)"
[nodes]="tinys" [options]="options">
<ng-template #treeNodeTemplate let-node let-index="index">

{{ node.data.label }}


Attached is my package.json
package.json.txt

Attached is my example json.
slowexpand.json.txt

I am using chrome Version 60.0.3112.113

Thank you.
-John

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions