How to visually group classes without showing a package name?

0 votes
asked Apr 25 in Question / help by dragondive (520 points)

I want to group some classes in my class diagram, without specifying a name for the package. I thought I could adapt the answer given here (https://forum.plantuml.net/3648/invisible-packages-improve-layout-diagrams-visible-packages) for this purpose.

However, this seems to not work with package style of Rectangle, which I would prefer using here. 

I tried with package dynamic <<Rectangle>> <<Layout>> as well as mentioning packageStyle Rectangle in the package block, but neither seems to work.

I want to avoid the "ugly" protrusion in the grouping shape. Is there a way to achieve this, or another approach to group classes?

https://www.plantuml.com/plantuml/uml/TOyn3i8m34NtdE9V0UQggeG42mC35p2DgQecJkMuGuIuEwK5iPGiaVp-jvwRRAGsnU20FFGoabB4IEr07LVLcKgQhAxnS9ZVBQbdFQIG55SboNESnLOsTpfDa_YLNoZmIPbbeVSajjtBnih9oiZ7FvcdS_WgmHUXsBVukJbyx80sKCw8PVbtMyFzigzXyU-RNm00

PlantUML diagram

@startuml
skinparam package<<Layout>> {
    borderColor Transparent
    backgroundColor PaleGreen
    fontColor Transparent
    stereotypeFontColor Transparent
  }

  package dynamic <<Layout>>
  {
      class myclass1
      class myclass2
  }
@enduml

1 Answer

+1 vote
answered Apr 26 by kirchsth (6,240 points)
selected Jul 3 by dragondive
 
Best answer

If you want a rectangle then the bracket has to be in the same line as the rectangle "rectangle .... {"
(click on the image you see source)



BR Helmut

commented Apr 26 by kirchsth (6,240 points)

If you add a "hide <<Layout>> stereotype" line and set the skinparam "fontSize 0" (of <<Layout>>) too then I think you get what you want.


BR Helmut

...