NLayeredGraphLayout and Top-Level Nodes


Author
Message
Patrick Bergeron
Patrick Bergeron
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1

I am using the NLayeredGraphLayout to create a graph from a dataset.  The diagram can have multiple top-level nodes (nodes with no parent).  When dealing with multiple top-level nodes, I noticed that the algorithm places these shapes in various locations within the document.  To remedy this, I created a "dummy" root node and parented all top-level nodes to this new dummy node.  Now the graph draws all top-level nodes correctly.  The problem is, I do not want the dummy node (and the edges from the dummy node to the top-level nodes) to display.  I set the Visible = false property of the root node and edges.  While these nodes are hidden as expected, there is now a blank white space above the top-level nodes.

How would I go about getting the top level nodes to draw as they do now, but without white space left by hiding the dummy node and its edges?

Any help would be greatly appreciated.

 

Thanks.


Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

there are 2 possible solutions:

  1. You can simply set the NodeRank property of the layered graph layout to TopMost. In that case you won't even need to insert the dummy node.
  2. You can insert the dummy node, layout the graph and then simply remove the dummy node and all edges connected to it.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search