Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align blocks in PlantUML class diagrams?

Tags:

uml

plantuml

I am using PlantUML to make simple class diagrams and the tool is awesome, but I couldn't find any way to align classes with each other except putting them into packages or using relationships like Alice -left-* Bob. What I need is something like:

@startuml   class Bob   class Alice   class Dan   **Dan aligned Alice: horizontally**   'or using a grid?   **Bob at grid (2, 3)**   @enduml 

Is there a way?

like image 392
Yuriy Kulikov Avatar asked Jul 19 '12 09:07

Yuriy Kulikov


People also ask

How do you center text in PlantUML?

When we want to text to be center aligned we simply use the new-line character \n . If we want to have our text left aligned we use \l instead of \n . And to right align the text we use \r . Written with PlantUML 1.2017.

What is PUML format?

File created by PlantUML, a UML diagram creator used within programs like Sublime Text Editor or programming language like HTML; same as the . PU file; contains code referenced by PlantUML to create diagram images that can be generated as .

How do I add a note in PlantUML?

It is possible to put notes on message using the note left or note right keywords just after the message. You can have a multi-line note using the end note keywords.

How do you represent implements in class diagram?

In domain modeling class diagrams, an implements relationship represents a class that implements the operations in a Java™ interface. As the following figure illustrates, an implements relationship is displayed as a dashed line with an unfilled arrowhead.


1 Answers

Using a -[hidden] relation can do the job :

@startuml   class Bob   class Alice   class Dan   class Foo class Bar class Foobar  Bob -[hidden] Alice Bar -[hidden] Foobar @enduml 

http://www.plantuml.com/plantuml/png/Iyv9B2vMSCfFKb3WIWQp7NCoarFXF9V4F3ZRBJyVod9AB4A89G4vN20JTACpCbDIKlDY8MPm0LKXYK5K0W00

like image 82
freezed Avatar answered Sep 21 '22 09:09

freezed