need help in layout among and inside packages

0 votes
asked Oct 11, 2018 in Question / help by 62mkv (120 points)

Hi community!

I've tried to draw something really usefule with PlantUML

This is what I've managed to compose so far:

I have several issues with this (sorry, couldn't figure out how to add an image directly in to post):

1) I would like to have "3rdParty" strictly below "Microservice", like a layer, and a database probably spanning right to both of them, like this




I was trying to use ---- separators but it seems as they only work in texts (

2) inside the microservice layer, I would like to have components Coordination, service1 and service2 be placed one under another, right to the ActiveMQ box, and have simple horisontal arrows linking them to Topics endpoint

however I was unable to achieve this. I've tried to use "transparent" packages

skinparam package<<Layout>> {
  borderColor Transparent
  backgroundColor Transparent
  fontColor Transparent
  stereotypeFontColor Transparent
and also 
!pragma horizontalLineBetweenDifferentPackageAllowed
but it only makes things worse. Also, I've never figured out how to remove that "3d shadow" effect to the right and bottom of the package border

Is it my poor understanding of PlantUML or it's inherent limitations that do not allow for more pretty and predictable component layout on a diagram ? 

1 Answer

+1 vote
answered Oct 24, 2018 by mgrol (3,150 points)


manual positioning is a pain in the ... as graphviz does it automatically.

I've changed your graph and added "d" for down. Other directions would be up, left, right. However, in general this is not the preferred way to do. What you need to keep in mind is that the longer the arrow, the less important it is (ranking). If you have connections that should not be considered in the automatic positioning add a norank, which is the oposite of hidden. Just in case this is new to you, the attribute hidden, means do not show but rank it, norank means show it but do not rank it for the graphics (a --> b bs a-[norank]-> b).

By adding more and more components it gets more challenging to layout. However, just play a bit around with the length and therefore the ranking before you add the direction.