Is it possible to center-align elements?

0 votes
asked Apr 1, 2022 in Question / help by Eric0821ZZ (120 points)
edited Apr 1, 2022 by Eric0821ZZ

I would like to align two Tomcat centers with Nginx. Is this possible?


can't upload the image, here's the image link: https://ibb.co/zsQjhCV

@startuml
skinparam linetype ortho

rectangle "<size:50>App" as App
rectangle "<size:50>Nginx" as Nginx
together {
collections Tomcat_1[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]
collections Tomcat_2[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]
}
database "<size:50>MySQL" as MySQL

App <-> Nginx
Nginx <-l-> Tomcat_1
Nginx <-l-> Tomcat_2
Tomcat_1 -[hidden]- Tomcat_2
Tomcat_1 <-> MySQL
Tomcat_2 <-> MySQL
@enduml

1 Answer

+1 vote
answered Apr 1, 2022 by The-Lu (63,000 points)
selected Apr 2, 2022 by Eric0821ZZ
 
Best answer

Hello E.,

You can use `left to right direction`, as:

1st proposal:

@startuml
left to right direction
skinparam linetype ortho

rectangle "<size:50>App" as App
rectangle "<size:50>Nginx" as Nginx

collections Tomcat_1[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]
collections Tomcat_2[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]

database "<size:50>MySQL" as MySQL

App <--> Nginx
Nginx <-r-> Tomcat_1
Nginx <-l-> Tomcat_2
Tomcat_1 <--> MySQL
Tomcat_2 <--> MySQL
@enduml

2nd proposal:

@startuml
left to right direction
skinparam linetype ortho

rectangle "<size:50>App" as App
rectangle "<size:50>Nginx" as Nginx

collections Tomcat_1[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]
collections Tomcat_2[
    == <size:30>Tomcat
    {{
    rectangle WAR {
        component UI
    }
}}
]

database "<size:50>MySQL" as MySQL

App <--> Nginx
Nginx <--> Tomcat_1
Nginx <--> Tomcat_2
Tomcat_1 <--> MySQL
Tomcat_2 <--> MySQL
@enduml

If that can help,
Regards.

commented Apr 2, 2022 by Eric
Great!

That's what I want!

Thanks a lot.
...