Position and size alignment of packages in component diagram

0 votes
asked May 2 in Wanted features by ANS

First of all: PlantUML is a great tool. I would also like to use it to create some software architecture overview using a component diagram.
However I'm facing the problem that the layout is not looking very well. I can control it in a limited way using hidden connections but I would like to have the packages and rectangles having the same size and position.
Consider the following example:

@startuml
package Package1 {

  package 1A {

    rectangle "Short" as rs {     
    }

    rectangle "Long long text" as rl {     
    }

    rs -[hidden]d-> rl
  }

  package 1B {

    rectangle "Foo" {     
    }   
  }

  1A -[hidden]-> 1B
}

package Package2 {

  package 2A {

    rectangle "Bar" {
    }
  } 
}

package Package3 {
}

Package1 -[hidden]> Package2
Package2 -[hidden]> Package3
@enduml

This results in:

What I would like to have is something like this:

Would it be possible to add a possibility to provide more layout information, e.g. the height of Package2 is at least the height of Package1? Same applies to width, vertical position etc.

commented Oct 10 by Kirill Marchuk
is this also reason we can't use separators (---- and friends) inside packages ?

1 Answer

0 votes
answered May 2 by plantuml (183,480 points)
Unfortunately we are facing some GraphViz limits here. I don't think we can achieve your example using Dot/GraphViz. Sorry about that.

The only think we could try is to use or create another layout engine. In your example, there are no link/edge. Is this because you've posted a simplified diagram ?
commented May 3 by anonymous
edited May 9
Thanks for the quick reply. So is there an option to use a different layout engine and what engine would that be?
The example has intentionally no relations (if that is meant by 'link') because it shall be used to provide a high level overview over the software architecture (packages and components but not the relations between them).
commented Jul 5 by albert (2,340 points)
Would a subgraph (in graphviz terms) be something?
commented Jul 5 by plantuml (183,480 points)
Unfortunately no.
We already use subgraph for packages.
There are no easy way to force height of subgraph.
If you are curious, you can use "!pragma svek_trace on" to spy on graphviz dot files generated by PlantUML. See http://forum.plantuml.net/1343/how-to-implement-new-graphviz-attribute
...