need help in layout among and inside packages

0 votes
asked Oct 11 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:

http://www.plantuml.com/plantuml/png/TPF1Rjim38RlUWh1znpSNOEWNPS10nPidGraLqPcFQ6EP51oiM3mkqzXx37n59yiVh_uamJr629G78wTKk7DkXu8Zhe7ymOjhjTVuUI7kDdeFqhhWwS6wTbtddHDu48IeujdalGj-S4rEVhgNSp5GqH27qyzViugHgMcGlIs-iWbQ6tyiVSkOLtiC0HehMiBjKHxFEWAwTqQ30NVl7pM9SzNC2dZpxhSLng2Biw_UbyLh1fLyXNZfxxlh85elKjfM36ZdJNamyNaoaAgUFQU6dRWF-iuJP5HRd_7CXCkdaoqxxXxaHQMRTI-joRSWIy33YXmp5ZKWtFObNV9GuPCWttWrkP3SLzONWlBdF2J3Jr4ymj9gHdBxVLgi-XJIiWm7lOrcCbqJcYrx6uQbLwbMqlqRys4oi3cCxEbdxIbry8pYHEz4cVkStgkKTBprloNUBpm1Y8S8A3-Hc0wlDtS3zHy1ugdxDP-SH5RWkWfysf-RAiwk-c4SvWrNDPjMF8Ab8gdRiw0FPJCbdiKvyiKECUorkbD9oGlwcp3op0DGZPa9S5HFQ9hXcFt5m00

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

microservice

                                      database

3rdparty

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 by mgrol (2,560 points)

Hi,

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.

http://www.plantuml.com/plantuml/uml/TLInRjim4Dtv5QoMJXgSheOH9t610Z6Qr0PSeEXmbiuo4PaKZgUaRg1_ZoXQOYpJciHxJ-yz7e-wjGp4zQ4KNxzK1CK1vDwG-cyqG_ceDDuXlo7g1xNR8Q7c9yXUeC1vMPetp8MmBqfNG72GbKUcqqSucffdC_akfDmQof7kJMb8hWcqhS39EAJb5sHgdSVGdT4Sgrj6GiF72hz76OqGfo1oiRfp4TedCuVAQDGiaoLQ2uNIHIB6q0QtSeNqgZAqYV-oUvHcf1rahUBlzMIpac1bubxbPfLqh4Outy5uNbMboe2LqVBTs_JGKcLah3VfBSvIBFxn959EvXchLrm-Xs3ZS6jJgSnU0Pzhh360JSHYNMkDvUGgSXD17fIjWBCzaXXGDWNo7YcslRw_DrqF-qLodJZvJ9p4YFV6KDwnkZUbkxu7vY2K_jchF4VzDmqf0gkl19PN3fJcKdAQpaPj3q8Hp0i6G0o8NxTGcewxVJewsKAp2soOPfdcFHoEi5_BD68PZixP3eI8zBJL3dIAARZlVSvWu2RvKhhnX1mOjc1H_YJ8IZo_9DyeVmBYOtI2VcZ6We0DHIxehyLg7PqHmg7iE2xNxBmST0CO4f-sqmBUGtngh-FxQZWkhp7AwdyV3WhNtDcuaUWR4UOa3SL6tABEwqFv0G00

BR,

Michael

...