Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic set node as rootnode (Read 3096 times)
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
set node as rootnode
May 14th, 2019 at 5:52am
Print Post  
Please anyone help me in the issue:I want to set a node as a root node at level 0 , so that other then that all the created nodes will display on its next level. How can I achieve it.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: set node as rootnode
Reply #1 - May 14th, 2019 at 9:09am
Print Post  
Hi,

As suggested in this post: https://mindfusion.eu/Forum/YaBB.pl?num=1557728236/3#3, you can set the AllowIncomingLinks property to false and this will restrict the root node to only permit outgoing links, so when using Tree or Layered layout, the root node will be always at the first level.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: set node as rootnode
Reply #2 - May 15th, 2019 at 11:09am
Print Post  
It is not working, still it in on the same level of other node
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: set node as rootnode
Reply #3 - May 15th, 2019 at 12:26pm
Print Post  
Him

Try setting the MultipleGraphPlacement property of the layout to Vertical, and it should orient the graph so that the root node is at the top.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: set node as rootnode
Reply #4 - May 16th, 2019 at 4:30am
Print Post  
multipleGraphPlacement is integer property. And by default it is set to 1, what should I set into it to get it vertical.

Actually I made a default node with the following code and I want to set it at the top :
var root = diagram.getFactory().createShapeNode(bounds);
root.setShape("Ellipse");
root.setBrush("yellow");
root.setText(workflowname);
root.setLocked(true); // prevent drawing links

var rootNode = root;
and with the following code I am setting it as the root node.
var layout = new LayeredLayout();

  layout.Root = rootNode;
layout.nodeDistance = 15;
layout.layerDistance = 15;
diagram.arrange(layout);

and now U want to get it at the top.
In the below diagram yellow node is my default and want to have it at the top of "Step" Please help
  

flowchart_001.bmp ( 292 KB | 156 Downloads )
flowchart_001.bmp
Back to top
AIM  
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: set node as rootnode
Reply #5 - May 16th, 2019 at 4:58am
Print Post  
I set it to 0 and it worked. Now I want to set the root node to the center. Please help me to achieve this.
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: set node as rootnode
Reply #6 - May 17th, 2019 at 8:38am
Print Post  
Hi,

You can set the root node's position by calling its setBounds method on the client side. To get the diagram view's bounds, call its getBounds method, or getContentBounds, if you want to get only the bounding rectangle of all items present.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint