Direction constrains not respected between component when defined in a package

+4 votes
asked Jul 9, 2013 in Bug by anonymous

Hi,

Given this example:

@startuml

package A {
component Component1
}
package B {
component Component2
}

Component1 -right-> Component2

@enduml

The "right" direction is not respected. Visually the Component1 is on top of Component2

If you remove the packages, it works: the Component1 is on the left of the Component2

Is it a normal behavior due to the layout algo or a bug ?

Reproduce with v7971 / Graphviz 2.28.0 / Win7

Thanks for your help

3 Answers

0 votes
answered Aug 25, 2014 by anonymous
Dude! I'm facing the very same problem. Before making it to this QA, I tried everything without success. I've got a very big diagram so I need to order it. I'm leaving packages for the moment and replacing them with colors instead, but packages and nodes look amazing so it would be very nice to have this feature working.

Great work so far: even with this little bug (maybe it's not a bug), it's the best tool I've ever used.

Thanks in advance and best regards.
0 votes
answered Aug 26, 2014 by rmric (2,140 points)

This is an old known bug, still happening with v8004: http://plantuml.sourceforge.net/qa/?qa=1628/layout-of-grouping-component

I'd love to see it squashed smiley
Let us know how we can help.

+2 votes
answered Aug 26, 2014 by plantuml (252,100 points)

This one is not easy to fix...
Depending of GraphViz version, allowing two nodes to have the same rank when they do not belong to the same cluster causes sometimes a crash.

To avoid those crashes, we were simply ignoring the setting -left- / -right- because we though that it was better to have a buggy diagram than a crash.

Anyway, if we want to really fix it, we need to better understand what's going on.

So we have added an option "horizontalLineBetweenDifferentPackageAllowed" to enable horizontal links between packages.
(Sorry about the long name, it's just to emphasize the fact that this option is temporary)

For example:

@startuml
!pragma horizontalLineBetweenDifferentPackageAllowed
package A {
component Component1
}
package B {
component Component2
}
Component1 -right-> Component2
@enduml


You can download a beta that enable this: https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
(note that this pragma option will be also present in future official release).

As you'll see, the result is still not perfect : we are interested in feedback from users.

Regards,
 

commented Sep 30, 2014 by MJ (180 points)
Hi Plantuml,

Where can i get the beta version? The link seems to be broken.

Thanks!!
commented Sep 30, 2014 by plantuml (252,100 points)
Well this is integrated in the last official release, so you can use it from there : http://www.plantuml.com/download.html
commented Dec 8, 2015 by mogoye (140 points)
Hello all,

Event if this post is an old one, your tip to add
!pragma horizontalLineBetweenDifferentPackageAllowed

helps me a lot !
Thanks
...