Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrows has tooo long distance (Read 1947 times)
CevatKelle
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 3rd, 2007
Arrows has tooo long distance
Oct 3rd, 2007 at 7:02am
Print Post  


i modified flowchart.net tree layout sample a bit.
i am inserting my objects from database

my project is a bit diffrent because each item can have more than one parent.

this is a sample of links table in my database

item1   item2
-----------------
0          1
0          2
0          3
1          4
1          5
4          5
4          2


I use this code to link them to eachother

   Box b = addChild(fc.FindBox(deviceid), r.id, title);

This is my addchild function which checks if something is inserted below and links it to appropriate box

  private Box addChild(Box node,int id, string title)
       {
           // get the group of the parent node
           Box childNode = fc.FindBox(id);
           bool newnode = false;
           if (childNode == null) {

               childNode = fc.CreateBox(0, 0, 30, 20);
               newnode = true;
           }
           else childNode = fc.FindBox(id);

           int tag = 0;
           if (node != null) tag = (int)node.Tag;

           if (newnode)
           {
               Group prntGroup = fc.FindGroup(tag);

               if (node != null)
                   prntGroup.AttachToArrowPoint(childNode, 10);
           }

           if (node != null)  fc.CreateArrow(node, childNode);

           childNode.Tag =id  ;
           // link the parent node with the child


           // start a new group to which node children will be added
           if(newnode)
           
           {
           Group group = fc.CreateGroup(childNode);
           group.Tag = id;
           
           }
           rearrange();
           childNode.Text = title;
           return childNode;
       }

It places great big distances between my items. how can i avoid them? how can i make my autoarrowed diagram more compact to fit in a few papers? thank you
----------------

My other question is this.

when my diagram is about 100 page, the canvas ends in some point and i cant see the last item (it expands if i resize something until there but it is hard and annoying to do this many times)

how can i resize my canvas to show all controls in it?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrows has tooo long distance
Reply #1 - Oct 3rd, 2007 at 7:43am
Print Post  
I think this problem happens because of grouping child nodes to their parents in the tree. In that case, disable the TreeLayout.KeepGroupLayou option, and it should work better.

Even then, the TreeLayout works only with strictly hierarchical graphs where nodes have just one parent, and some links from your graphs will be ignored. You can either use LayeredLayout, or keep using TreeLayout but after applying it call the Route() method of each link that connects a node with its second parent.

Stoyan
  
Back to top
 
IP Logged
 
CevatKelle
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 3rd, 2007
Re: Arrows has tooo long distance
Reply #2 - Oct 4th, 2007 at 4:32am
Print Post  
Thanks
and a nodes children are displayed like xxxxxxxxx is there an option for making it like

xxx
xxx
xxx

like 3 columns table?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrows has tooo long distance
Reply #3 - Oct 4th, 2007 at 6:13am
Print Post  
At this time TreeLayout places all children of a node on the same level directly below the node. There isn't any option available to distribute the children in several levels.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint