Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Error in linking. (Read 10877 times)
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Error in linking.
Apr 22nd, 2009 at 9:30am
Print Post  
Hi ,

I have 4 nodes that i need to paint in tree layout.
the relation is:
9246 -> 9247
9246 -> 9248
9249 -> 9249

i send you the attachment. there is a problem.
thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #1 - Apr 22nd, 2009 at 9:36am
Print Post  
The graph from the attachment is not a tree. Use LayeredLayout instead of TreeLayout.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #2 - Apr 22nd, 2009 at 9:42am
Print Post  
Hi,
my data relation is a tree relation.
its works in almost all the time,but when i have more that one root (9246,9249) its occurs.

(i tried the LayeredLayout but its still not good, i send the attach).

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #3 - Apr 22nd, 2009 at 9:57am
Print Post  
TreeLayout uses this definition of a tree Wink

Set larger LayerredLayout.NodeDistance and it will look better.

  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #4 - Apr 22nd, 2009 at 9:59am
Print Post  
I tried this , and its still occur (9249 cover 9246).
see attach in mail.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #5 - Apr 22nd, 2009 at 12:32pm
Print Post  
The last attachment still shows TreeLayout.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #6 - Apr 22nd, 2009 at 12:37pm
Print Post  
Hi,

in the attach you didnt see the 9246 (there are 4 shapes, look at bottom the relation).

look now at the attach i send (linkError3.jpg),
the 9249 is not arrange right (and the link from him is strange).

Thanks
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #7 - Apr 22nd, 2009 at 12:42pm
Print Post  
Hi,

Try this code and see.

MindFusion.Diagramming.Silverlight.ShapeNode node1 =  diagram.Factory.CreateShapeNode(0, 0, 60, 60);
node1.Text = "9246";

MindFusion.Diagramming.Silverlight.ShapeNode node2 = diagram.Factory.CreateShapeNode(0, 0, 60, 60);
node2.Text = "9247";

MindFusion.Diagramming.Silverlight.ShapeNode node3 = diagram.Factory.CreateShapeNode(0, 0, 60, 60);

node3.Text = "9248";

MindFusion.Diagramming.Silverlight.ShapeNode node4 = diagram.Factory.CreateShapeNode(0, 0, 60, 60);

node4.Text = "9249";

diagram.Factory.CreateDiagramLink(diagram.Nodes[0], diagram.Nodes[1]);
diagram.Factory.CreateDiagramLink(diagram.Nodes[0], diagram.Nodes[2]);
diagram.Factory.CreateDiagramLink(diagram.Nodes[3], diagram.Nodes[2]);


TreeLayout tree = new TreeLayout();
tree.Root = diagram.Nodes[0];
tree.Direction = TreeLayoutDirection.LeftToRight;
tree.LinkStyle = TreeLayoutLinkType.Cascading3;
tree.LevelDistance = 40;
tree.NodeDistance = 40;
tree.Arrange(diagram);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #8 - Apr 22nd, 2009 at 1:08pm
Print Post  
The idea was to call LayeredLayout.Arrange when the graph is not a tree. Just use larger LayeredLayout.NodeDistance.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #9 - Apr 22nd, 2009 at 1:11pm
Print Post  
Hi,

this relations is tree:

9246 -> 9247
9246 -> 9248
9249 -> 9249

4 differents nodes, with one link of each pair.

look at the attachment in the mail you will see that the "9249" and his link is not drawing right.
(you can use the code i attach here).

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #10 - Apr 22nd, 2009 at 6:04pm
Print Post  
If you consider link direction, it's a DAG. You could enable TreeLayout.IgnoreLinkDirection, and set TreeLayout.Root = 9246, and TreeLayout will process it successfully. However the result might not be what you expect.

Stoyan
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #11 - Apr 25th, 2009 at 8:48am
Print Post  
Hi,

Thanks for the answer, but its individual solution.
i dont now in real time who is that the '9246' is the root.
i think that this problem occur when you have more that one node in the min level of the tree.
can you supply us solution for this problem? this case can be often.

Thanks.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #12 - Apr 26th, 2009 at 9:27am
Print Post  
Hi,

I sent you (email) another example that demonstrate this bug:

tree with 4 roots( 4 shapes in the minimun level of the tree), look that you see only 2 roots , the others are covers.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Error in linking.
Reply #13 - Apr 26th, 2009 at 1:32pm
Print Post  
With the IgnoreLinkDirection option, any node can be set as a root. You could set TreeLayout.Root = diagram.Nodes[0], or for example choose the node with most links. Anyway, I'm pretty sure you should use LayeredLayout with such graphs.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Error in linking.
Reply #14 - Apr 26th, 2009 at 1:43pm
Print Post  
Hi,

I sent you in email example.
fou our requirment we need the link direction.

i need that the "9249" will be in the first level of the tree.

I think that you have a bug when there is more than one shape in the minimum level of the tree (more than one root).

Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint