Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TreeLayout: boxes without link arrange issue (Read 2022 times)
rand_acs
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jan 23rd, 2007
TreeLayout: boxes without link arrange issue
Jan 23rd, 2007 at 11:30am
Print Post  
Hi,

I'm looking at FlowChart.NET for a project that I'm working on. Thus far I'm very impressed.

I'm using the TreeLayout class to arrange my FlowChart that contains some Groups of nodes. The graphs that I want to render might not have dependencies between the nodes in the graphs at certain points of their lives.

When I have nodes in a graph with dependencies between these nodes everything renders perfectly (love all the options and looks). My problem is when a node has no dependencies, thus not having any link, it gets "lost" or rendered over.

For example: I have n01 and n02. I put them in the graph, first n01 then n02. They have no link between them. When I render the image created by the FlowChart instance I only see n02.

These are the FlowChart properties I used:

_flc.AntiAlias = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
_flc.MeasureUnit = GraphicsUnit.Pixel;
_flc.DocExtents = new RectangleF(0, 0, 600, 400);
_flc.BackColor = Color.White;
_flc.SelectAfterCreate = false;
_flc.SelHandleSize = 6;
_flc.BoxStyle = BoxStyle.Rectangle;
_flc.RoundedArrows = true;
_flc.RoundedArrowsRadius = 12;
_flc.ArrowHead = ArrowHead.PointerArrow;
_flc.ArrowHeadSize = 15;

And the TreeLayout properties:

_tl = new TreeLayout();
_tl.Root = _rootNode;
_tl.Type = TreeLayoutType.Centered;
_tl.Direction = TreeLayoutDirection.LeftToRight;
_tl.ArrowStyle = TreeLayoutArrowType.Straight;
_tl.KeepRootPosition = true;
_tl.NodeDistance = 100;
_tl.LevelDistance = 100;

What can would I do so all the boxes get rendered?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout: boxes without link arrange issue
Reply #1 - Jan 23rd, 2007 at 1:35pm
Print Post  
Hi,

If a graph contains several unconnected subgraphs, they are arranged in a row or a column. So the unconnected nodes probably appear in the far right of the diagram if the tree is very wide. You could use the TreeLayout.MultipleGraphsOrientation property to move the unconnected nodes into a column below the tree.

If you need to keep the unconnected nodes inside the tree, you might have to add temporary links just for the sake of arranging the tree, and remove them after the layout completes. Or use the Node.AttachTo method to attach the unconnected nodes to another node in the tree, and run the layout using the KeepGroupLayout property.

Stoyan
  
Back to top
 
IP Logged
 
rand_acs
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jan 23rd, 2007
Re: TreeLayout: boxes without link arrange issue
Reply #2 - Jan 24th, 2007 at 6:23am
Print Post  
hi Stoyo,

Thanks for the quick reply, I will get on this issue today and report on what happened. Thanks again for the great support.

  
Back to top
 
IP Logged
 
rand_acs
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jan 23rd, 2007
Re: TreeLayout: boxes without link arrange issue
Reply #3 - Mar 26th, 2007 at 8:49am
Print Post  
I see that I have not reported my findings!

I tried your later suggestion but found that the TreeLayout didn't display the nodes that nicely taking that route.

I then tried to make a group of those nodes not linked yet and made their arrows invisible. This worked really well imo. They make a nice arch out of the way from the rest of the nodes.

Thanks for the advice.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout: boxes without link arrange issue
Reply #4 - Mar 26th, 2007 at 10:00am
Print Post  
thank you for sharing your findings  8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint