Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Groups Offset in Flow Layout (Read 10283 times)
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Groups Offset in Flow Layout
May 4th, 2009 at 9:21am
Print Post  
Hi,
I'm using FlowLayout and the diagram consists of many disjoint pieces (many root nodes in other words).
For some reason, the disjoint graphs are positioned rather far one from another. I tried to set the VerticalGroupOffset but it doesn't change.
Here are my layout definitions:

FlowLayout flowLayout = new FlowLayout();
flowLayout.AutoRoute = true;

[b]flowLayout.VerticalGroupOffset = 50;[/b]
flowLayout.NodeDistance = 60;

flowLayout.Margins = new Size(10, 10);
flowLayout.ChangeLaneDimensions = true;
flowLayout.RecreateGraph = true;
flowLayout.RandomSeed = new Random().Next();
flowLayout.KeepGroupLayout = true;
flowLayout.LaneDistance = 50;
flowLayout.LaneType = LaneType.LaneGrid;
// define direction rules for the connector types
FlowLayoutRules rules = flowLayout.LayoutRules;
rules.PreferredRules = PreferredRules.ConnectorRules;
if (Orientation == DiagramOrientation.LeftToRight)
{
rules.ConnectorRules.RightOriented = CONTROL_FLOW_NAME;
rules.ConnectorRules.DownOriented = BACK_FLOW_NAME;

}
else
{
rules.ConnectorRules.DownOriented = CONTROL_FLOW_NAME;
rules.ConnectorRules.RightOriented = BACK_FLOW_NAME;

}
// miscellaneous rules
rules.NodeRules.GroupStartNodes = START_NAME;
rules.NodeRules.GroupEndNodes = END_NAME;
rules.NodeRules.MainConnectorId = CONTROL_FLOW_NAME;
rules.NodeRules.MainConnectorOrientation = SimpleOrientation.LeftToRight;
rules.ConnectorRules.HorizontalBendOrientation = false;
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #1 - May 4th, 2009 at 2:20pm
Print Post  
Our developer will check this later this week. If it happens only with some specific diagram, please email the saved diagram file to support@mindfusion.eu; otherwise will test it with a random one.

Stoyan
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #2 - May 4th, 2009 at 2:22pm
Print Post  
It happens for all cases.

Thanks.
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #3 - May 5th, 2009 at 9:14am
Print Post  
Another matter that I encountered is the following:
Suppose I have simple graph like the following:
N1 -->C1
         ^
N2-----|

That is, 2 roots pointing to same child.
Using FlowLayout, the following is displayed actually:
N1-->C1<---N2
I want all root nodes to be left aligned.
How can I force the graph to be displayed correctly?

Thanks.
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #4 - May 6th, 2009 at 11:24am
Print Post  
We are in the process of buying the component so it's crucial for us to understand if it answers our needs. Please address my 2 questions as appears in this thread.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #5 - May 6th, 2009 at 1:56pm
Print Post  
Our developers will check this later this week. We've had a national holiday and they'll return from vacation tomorrow.
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #6 - May 6th, 2009 at 2:35pm
Print Post  
I've found solution to at least one problem I had:
Both ConnectorRules.RightOriented,ConnectorRules.DownOriented and NodeRules.GroupStartNodes and NodeRules.GroupEndNodes are object properties. I provided string keys while array was expected.
GUYS, YOU SHOULD THROW EXCEPTION IN SUCH CASE!!! The values I gave were swallowed without any notification and the properties were left NULL. I think you should review your designs.
It behaves much better now.

I still need an answer to my question from 05.05

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #7 - May 7th, 2009 at 10:25am
Print Post  
According to our developer, the N2->C1 link id should be in the left-oriented group for the graph to be arranged like that. Regarding the design, we have implemented this based on customers' specification, the NodeRules were what the original FlowLayout was done for, and we later added the ConnectorRules for another customer. If you send us a short specification of what kind of rules you need, we can add support for them to one of these rule sets if it's close enough, or add a completely new one. We very much want to improve the design indeed, but have some more pressing matters at this time.

Stoyan
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #8 - May 7th, 2009 at 11:08am
Print Post  
Hi,
The layout definitions appear in this thread.
I will post it again (fixed):
FlowLayout flowLayout = new FlowLayout();
           flowLayout.AutoRoute = true;
           flowLayout.VerticalGroupOffset = 20;
           flowLayout.NodeDistance = 60;
           flowLayout.Margins = new Size(10, 10);
           flowLayout.ChangeLaneDimensions = true;
           flowLayout.RecreateGraph = true;
           flowLayout.RandomSeed = new Random().Next();
           flowLayout.KeepGroupLayout = true;
           flowLayout.LaneDistance = 10;
           flowLayout.MinLaneHight = 100;
         
           // define direction rules for the connector types
           FlowLayoutRules rules = flowLayout.LayoutRules;
           rules.PreferredRules = PreferredRules.ConnectorRules;
           if (Orientation == DiagramOrientation.LeftToRight)
           {
               rules.ConnectorRules.RightOriented = new string[] {CONTROL_FLOW_NAME};
               rules.ConnectorRules.DownOriented = new string[] {BACK_FLOW_NAME};
              
               rules.NodeRules.MainConnectorOrientation = SimpleOrientation.LeftToRight;

           }
           else
           {
               rules.ConnectorRules.DownOriented = new string[] {CONTROL_FLOW_NAME};
               rules.ConnectorRules.RightOriented = new string[] {BACK_FLOW_NAME};
               rules.NodeRules.MainConnectorOrientation = SimpleOrientation.TopToBottom;

            
           }
           // miscellaneous rules
           rules.NodeRules.GroupStartNodes = new string[] {START_NAME};
           rules.NodeRules.GroupEndNodes = new string[] {END_NAME};
           rules.NodeRules.MainConnectorId = CONTROL_FLOW_NAME;
           rules.NodeRules.VerticalSubgroupsAlignment = true;

           rules.ConnectorRules.HorizontalBendOrientation = false;
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #9 - May 7th, 2009 at 12:59pm
Print Post  
Hi,

I didn't need to see your code again, but meant you could send us a short specification that shows what kind of rules you need the layout to support, and our developer can implement them for next release.

When using the ConnectorRules set, you can only specify the relative position of nodes that are connected by links, depending on the links ID. FlowLayout will arrange the graph like that if the LogicID of the N2->C1 link is in the ConnectorRules.LeftOriented. However this won't ensure that root nodes will always be on the left side for any graph. So if ConnectoRules produce something close to what you need, and you only want to ensure that some nodes are always at the left side, we can add support for a rule that places nodes with certain LogicIDs aligned at the left side of the diagram.

Stoyan
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #10 - May 7th, 2009 at 1:04pm
Print Post  
I've sent you the details by email.
I did not define anything in ConnectorRules.LeftOriented, that is why I posted the code again. What I'm trying to say is that the behavior is different from what I expect. I don't think I'm doing something special and don't need additional rule types.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #11 - May 8th, 2009 at 7:25am
Print Post  
Hi,

It seems VerticalGroupOffset is ignored when using ConnectorRules, our developer will fix this today.

As for start nodes, the connector rules mode expects only one such node for each group. It takes the first start node found, and start to traverse the graph items recursively, where each next node is placed as defined by the link-orientation rule for the LogidID of the link that leads to the node. So it cannot work as you expect it at this time; we'll try to add support for multiple start nodes in the next few days.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #12 - May 8th, 2009 at 1:02pm
Print Post  
Apparently in your case MinLaneHight overrides VerticalGroupOffset, and the subgraphs are placed at 100 units from each other rather than 20.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
lex
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Mar 22nd, 2009
Re: Groups Offset in Flow Layout
Reply #13 - May 10th, 2009 at 6:50am
Print Post  
Hi,
Unfortunately setting MinLaneHight = 20 doesn't help.

As for the groups:
Is it a component restriction that 2 flows starting from different route nodes cannot have same child node?
How wiil this be treated:
R1->N1->N2->N3
^
R2->N4---|

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Groups Offset in Flow Layout
Reply #14 - May 10th, 2009 at 10:12am
Print Post  
It is a restriction of the connector-rules mode that groups have only one start node. If otherwise the result is close to what you need, we can add support for more start nodes in the next few days.

You might also check the new FlowchartLayout class we are developing:
https://mindfusion.eu/_beta/wpfdiag_flowchartlt.zip

It supports constructs such as decisions and loops in code, and the result looks like this:



FlowchartLayout has some support for more than one start nodes. However currently it creates only vertical layouts. We'll add an Orientation property for the final release.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint