why are arrows to rectangles contain sub elements different than rectangle with no elements?

0 votes
asked Mar 15, 2023 in Question / help by anonymous
@startuml

rectangle thing1
rectangle thing2 {
  rectangle subthing1
  rectangle subthing2
}
user --> thing1
user --> thing2
@enduml

can I make the arrow from user to thing2 be to the center top of the rectangle as it is in thing1?

1 Answer

0 votes
answered Mar 16, 2023 by The-Lu (63,920 points)

Hi A., and all,

can I make the arrow from user to thing2 be to the center top of the rectangle as it is in thing1?

Not yet... (expect a possible proposal: see below) due to the management of nested element...

Here some other elements of answer...:

Here is a proposal, using sub-diagram:

@startuml
rectangle thing1

rectangle thing2 [
{{
  rectangle subthing1
  rectangle subthing2
}}
]
user --> thing1
user --> thing2
@enduml

If that can help,

Regards,
Th.

commented Mar 16, 2023 by anonymous
Thanks for the reply.

The issue that I had with using sub-diagram,  I cannot have arrows out of the sub-diargram to other parts of my diagram.

If I can say briefly what I am trying to do.

1. have a "high-level" deployment diagram with "micro services" identified by a rectangle.

2. then have a Level -1 detail where I expand the components inside the microservice and show how they interact with other micro-services.  So I want elements of the sub-diagram to have arrows out to the rest of the diagram.

Thanks.
commented Mar 16, 2023 by The-Lu (63,920 points)

If I can say briefly what I am trying to do.

1. have a "high-level" deployment diagram with "micro services" identified by a rectangle.

2. then have a Level -1 detail where I expand the components inside the microservice and show how they interact with other micro-services.  So I want elements of the sub-diagram to have arrows out to the rest of the diagram.

Perhaps, for that you can see on C4-Architecture, see:

...