How can I define small (outer) rectangles?

0 votes
asked Jul 1, 2021 in Question / help by kirchsth (4,880 points)

I want to use surrounding rectangles (eg. red and green) as additional markers of a component.

source:

How can I reduce the size of them that I have e.g. only 5 pixels in all directions, without stereotype and empty text?

Thank you and best regards
Helmut

1 Answer

0 votes
answered Jul 1, 2021 by The-Lu (63,920 points)

Hello K.,

Here is a funny workaround, as:

@startuml
hide stereotype

<style>
rectangle {
  .zoneGreen {
    LineColor green
    LineThickness 10
  }
  .zoneRed {
    LineColor red
    LineThickness 10
  }
}

group {
  BackGroundColor green
  LineColor green
  LineThickness 1
}
</style>

person "person" <<p>>
rectangle "comp green" as cg <<zoneGreen>>

card {
rectangle "comp red+green" as crg <<zoneRed>>
}

rectangle "comp red" as cr <<zoneRed>>
person -> cg
@enduml

And it shows some defects on the styles of nested elements (cf. card vs group crying)
No other group or nested elements are possible without green border !!!

If that can help, but it is only a demonstrative workaround...wink
Regards,
Th.

...