Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Double tree partial layout

$
0
0

@zekelynch wrote:

Hello!

Again, it is about the double tree layout…

We try to modify the tree layout dynamically(after the layout has been set): we need to remove some nodes and then partially re-layout the nodes into tree structure.

We somehow managed to do that using remove(), commitTransaction(), doubleTreeLayout(). Here’s the code:

data.forEach(v=>{
        let node = this.myDiagram.findNodeForKey(v.key)
        if(!v.check){
          if(node){
            this.myDiagram.remove(node);
            this.myDiagram.commitTransaction("deleted node");
          }
        }else{
          if(!node){
            this.myDiagram.model.addNodeData(v);
          }
          console.log('changeLinkData==>>>',node)
        }
      })
this.doubleTreeLayout(this.myDiagram);

However, the line connections were acting weird after the actions. These are some photo to visualize the problem:
1)


2)
]
3)

So, is there anyway we could fix the lines problem? Also, we lost the animation when we try to re-layout the nodes.

Thank you very much for helping us!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles