Monday 15 April 2024

PlantUML: zoom the diagram using scale command

‘scale’ command is used to zoom the generated image. There are multiple ways to express the scale.

Example 1: Express scale factor as a number or fraction.

scale 2.5

scale 3/2

 

Example 2: Specify either width or height in pixels.

scale 250 width

scale 350 height

 

Example 3: Specify both width and height.

scale 250*350

 

How to set maximum height, width?

Using ‘scale max’ keyword, we can set maximum height and width.

 

scale max 350*250

scale max 500 width

scale max 1024 height

 

withoutScale.txt

@startuml

Client -> LoginServer: Enter user name
Client -> LoginServer: Enter password
Client -> LoginServer: Submit the form 
LoginServer -> ADServer: Check the credentials
ADServer -> LoginServer: Login Successful
LoginServer -> Client: Login Successful

@enduml

 

Above snippet generate below diagram.

 


With scale 500*1024

 

scale1.txt

@startuml

scale 500*1024

Client -> LoginServer: Enter user name
Client -> LoginServer: Enter password
Client -> LoginServer: Submit the form 
LoginServer -> ADServer: Check the credentials
ADServer -> LoginServer: Login Successful
LoginServer -> Client: Login Successful

@enduml

 

 

 


  

Previous                                                    Next                                                    Home

No comments:

Post a Comment