Deutsch      Español      Français      日本語      한국어      Русский      中文

Translation support

You can click here to access the wiki and update the translation.

You can go back to the translated webpage.

To help you in the translation process, here is a comparison with the English version :

UMLをアスキーアートで出力する

ASCII アートは、ASCII 文字のみを用いてダイアグラムを表現します。プレーンテキストのみで生成したダイアグラムは、ソースコードに含めたい場合に使い勝手が良いでしょう。

using ASCII art for UML diagrams

ASCII art is using plain ASCII character to draw images. It can be useful if you have only some plain text output, or to integrate diagrams in text source code.

 

 

アスキーアート

シーケンス図アスキーアートで出力することができます。

@startuml
participant Bob
actor Alice
 
Bob -> Alice : hello
Alice -> Bob : Is it ok?
@enduml

コマンドを実行するときに-txtフラグを付けるか、ANT タスクformatタグを付ける必要があります。

<target name="main">
  <plantuml dir="./src" format="txt" />
</target>

コマンドを実行すると、 .atxt という拡張子のファイルが作成されます。

実行結果の例

	                  ,-.  
	                  `-'  
	                  /|\  
	 ,---.             |   
	 |Bob|            / \  
	 `-+-'           Alice 
	   |    hello      |   
	   |-------------->|   
	   |               |   
	   |  Is it ok?    |   
	   |<- - - - - - - |   
	 ,-+-.           Alice 
	 |Bob|            ,-.  
	 `---'            `-'  
	                  /|\  
	                   |   
	                  / \  

 

 

Ascii Art

It is possible to generate Sequence Diagrams using ASCII Art.

@startuml
participant Bob
actor Alice
 
Bob -> Alice : hello
Alice -> Bob : Is it ok?
@enduml

You have to use the -txt flag in the command line, or the format tag in the ANT task :

<target name="main">
  <plantuml dir="./src" format="txt" />
</target>

Generated files use .atxt extension. ("a" as ASCII art : to NOT overide any existing .txt files!). Here is the result:

	                  ,-.  
	                  `-'  
	                  /|\  
	 ,---.             |   
	 |Bob|            / \  
	 `-+-'           Alice 
	   |    hello      |   
	   |-------------->|   
	   |               |   
	   |  Is it ok?    |   
	   |<- - - - - - - |   
	 ,-+-.           Alice 
	 |Bob|            ,-.  
	 `---'            `-'  
	                  /|\  
	                   |   
	                  / \  

 

 

Unicode

デフォルトのままだと、txtではASCII文字しか使用することができません。 ユニコードで使用できる文字を使えるようにすることで、多少マシな結果が出力されるようになります。そのためには、コマンドを実行するときのフラグを-utxtにするか、ANT タスクのフォーマットタグでutxtを指定する必要があります。

	                  ┌─┐  
	                  ║"│  
	                  └┬┘  
	                  ┌┼┐  
	 ┌───┐             │   
	 │Bob│            ┌┴┐  
	 └─┬─┘           Alice 
	   │    hello      │   
	   │──────────────>│   
	   │               │   
	   │  Is it ok?    │   
	   │<─ ─ ─ ─ ─ ─ ─ │   
	 ┌─┴─┐           Alice 
	 │Bob│            ┌─┐  
	 └───┘            ║"│  
	                  └┬┘  
	                  ┌┼┐  
	                   │   
	                  ┌┴┐  

utxtを使う上では、以下のような問題点があります。

  • 出力がUTF-8になるということ自体が問題になることがあります。(mail gateway や 使用するエディター など)
  • 使っているフォントが、UTF-8に対応している必要があります。(Courier など)

 

 

Unicode

The default txt format uses only plain ASCII characters. It is possible to use few extended Unicode characters to have a slightly better result. You should use the -utxt flag in the command line, or the utxt format in the ANT task.

	                  ┌─┐  
	                  ║"│  
	                  └┬┘  
	                  ┌┼┐  
	 ┌───┐             │   
	 │Bob│            ┌┴┐  
	 └─┬─┘           Alice 
	   │    hello      │   
	   │──────────────>│   
	   │               │   
	   │  Is it ok?    │   
	   │<─ ─ ─ ─ ─ ─ ─ │   
	 ┌─┴─┐           Alice 
	 │Bob│            ┌─┐  
	 └───┘            ║"│  
	                  └┬┘  
	                  ┌┼┐  
	                   │   
	                  ┌┴┐  

They are two drawbacks of using utxt:

  • The result is UTF-8 encoded, and sometimes this is an issue (mail gateway, editors...)
  • The used font must have the used extended characters (like Courier, Courier New...)

 

 

複雑な例

複雑な例を試してみましょう。

@startuml
'hide footbox

participant "Bob on\nseveral lines" as Bob
actor Alice

Bob -> Alice : hello
note right of Alice
  this is a note
end note

Alice -> Bob : Is it ok\nwith a message that is\non several lines?

note right
  This other note
  should work
  on several lines
end note

== This is a separation ==

Bob -> Last : Yes it works!
Last -> Last : working in progress
note left : this is\nanother note

Last --> Last : working in progress

Last --> Bob : done

opt dummy comment
  Bob -> Last : Error\nOn\nSeveral\nLine
  Last --> Bob : None
else
  Last --> Bob : None
  Last -> Bob : None
else other
  Last -> Bob : None
  note over Alice, Last
	This is a long note
	over Alice and Last
  end note
  Last -> Bob : None
  Last -> Bob : None
end
@enduml

 

 

Complex Diagram

You can even try complex example if you wish.

@startuml
'hide footbox

participant "Bob on\nseveral lines" as Bob
actor Alice

Bob -> Alice : hello
note right of Alice
  this is a note
end note

Alice -> Bob : Is it ok\nwith a message that is\non several lines?

note right
  This other note
  should work
  on several lines
end note

== This is a separation ==

Bob -> Last : Yes it works!
Last -> Last : working in progress
note left : this is\nanother note

Last --> Last : working in progress

Last --> Bob : done

opt dummy comment
  Bob -> Last : Error\nOn\nSeveral\nLine
  Last --> Bob : None
else
  Last --> Bob : None
  Last -> Bob : None
else other
  Last -> Bob : None
  note over Alice, Last
	This is a long note
	over Alice and Last
  end note
  Last -> Bob : None
  Last -> Bob : None
end
@enduml

 

 

Result

	                                         ,-.                                                   
	                                         `-'                                                   
	           ,-------------.               /|\                                                   
	           |Bob on       |                |             ,----.                                 
	           |several lines|               / \            |Last|                                 
	           `------+------'              Alice           `-+--'                                 
	                  |        hello          |               |                                    
	                  |---------------------->|               |                                    
	                  |                       |               |                                    
	                  |                       | ,--------------!.                                  
	                  |                       | |this is a note|_\                                 
	                  |                       | `----------------'                                 
	                  |Is it ok               | ,----------------!.                                
	                  |with a message that is | |This other note |_\                               
	                  |on several lines?      | |should work       |                               
	                  |<----------------------| |on several lines  |                               
	                  |                       | `------------------'                               
	                  |                       |               |                                    
	                  |              ======================== |                                    

 

 

Result

	                                         ,-.                                                   
	                                         `-'                                                   
	           ,-------------.               /|\                                                   
	           |Bob on       |                |             ,----.                                 
	           |several lines|               / \            |Last|                                 
	           `------+------'              Alice           `-+--'                                 
	                  |        hello          |               |                                    
	                  |---------------------->|               |                                    
	                  |                       |               |                                    
	                  |                       | ,--------------!.                                  
	                  |                       | |this is a note|_\                                 
	                  |                       | `----------------'                                 
	                  |Is it ok               | ,----------------!.                                
	                  |with a message that is | |This other note |_\                               
	                  |on several lines?      | |should work       |                               
	                  |<----------------------| |on several lines  |                               
	                  |                       | `------------------'                               
	                  |                       |               |                                    
	                  |              ======================== |                                    

 

 

================================ This is a separation =================================

                  |              ======================== |                                    
                  |                       |               |                                    
                  |            Yes it works!              |                                    
                  |-------------------------------------->|                                    
                  |                       |               |                                    
                  |                       ,------------!. |----.                               
                  |                       |this is     |_\|    | working in progress           
                  |                       |another note  ||<---'                               
                  |                       `--------------'|                                    
                  |                       |               |- - .                               
                  |                       |               |    | working in progress           
                  |                       |               |< - '                               
                  |                       |               |                                    
                  |                 done  |               |                                    
                  |<- - - - - - - - - - - - - - - - - - - |                                    
                  |                       |               |                                    
 ______________________________________________________________________                        
 ! OPT  /  dummy comment                  |               |            !                       
 !_____/          |                       |               |            !                       
 !                |                       |               |            !                       
 !                |               Error   |               |            !                       
 !                |               On      |               |            !                       
 !                |               Several |               |            !                       
 !                |               Line    |               |            !                       
 !                |-------------------------------------->|            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<- - - - - - - - - - - - - - - - - - - |            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<- - - - - - - - - - - - - - - - - - - |            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
 ! [other]        |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !                |                       |               |            !                       
 !                |                    ,-------------------!.          !                       
 !                |                    |This is a long note|_\         !                       
 !                |                    |over Alice and Last  |         !                       
 !                |                    `---------------------'         !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
           ,------+------.              Alice           ,-+--.                                 
           |Bob on       |               ,-.            |Last|                                 
           |several lines|               `-'            `----'                                 
           `-------------'               /|\                                                   
                                          |                                                    
                                         / \                                                  

 

 

================================ This is a separation =================================

                  |              ======================== |                                    
                  |                       |               |                                    
                  |            Yes it works!              |                                    
                  |-------------------------------------->|                                    
                  |                       |               |                                    
                  |                       ,------------!. |----.                               
                  |                       |this is     |_\|    | working in progress           
                  |                       |another note  ||<---'                               
                  |                       `--------------'|                                    
                  |                       |               |- - .                               
                  |                       |               |    | working in progress           
                  |                       |               |< - '                               
                  |                       |               |                                    
                  |                 done  |               |                                    
                  |<- - - - - - - - - - - - - - - - - - - |                                    
                  |                       |               |                                    
 ______________________________________________________________________                        
 ! OPT  /  dummy comment                  |               |            !                       
 !_____/          |                       |               |            !                       
 !                |                       |               |            !                       
 !                |               Error   |               |            !                       
 !                |               On      |               |            !                       
 !                |               Several |               |            !                       
 !                |               Line    |               |            !                       
 !                |-------------------------------------->|            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<- - - - - - - - - - - - - - - - - - - |            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<- - - - - - - - - - - - - - - - - - - |            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
 ! [other]        |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !                |                       |               |            !                       
 !                |                    ,-------------------!.          !                       
 !                |                    |This is a long note|_\         !                       
 !                |                    |over Alice and Last  |         !                       
 !                |                    `---------------------'         !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !                |                       |               |            !                       
 !                |                 None  |               |            !                       
 !                |<--------------------------------------|            !                       
 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!                       
           ,------+------.              Alice           ,-+--.                                 
           |Bob on       |               ,-.            |Last|                                 
           |several lines|               `-'            `----'                                 
           `-------------'               /|\                                                   
                                          |                                                    
                                         / \                                                  

 

 

Same example using Unicode

	                                         ┌─┐                                                   
	                                         ║"│                                                   
	                                         └┬┘                                                   
	           ┌─────────────┐               ┌┼┐                                                   
	           │Bob on       │                │             ┌────┐                                 
	           │several lines│               ┌┴┐            │Last│                                 
	           └──────┬──────┘              Alice           └─┬──┘                                 
	                  │        hello          │               │                                    
	                  │──────────────────────>│               │                                    
	                  │                       │               │                                    
	                  │                       │ ╔═════════════╧══╗                                 
	                  │                       │ ║this is a note ░║                                 
	                  │                       │ ╚═════════════╤══╝                                 
	                  │Is it ok               │ ╔═════════════╧════╗                               
	                  │with a message that is │ ║This other note  ░║                               
	                  │on several lines?      │ ║should work       ║                               
	                  │<──────────────────────│ ║on several lines  ║                               
	                  │                       │ ╚═════════════╤════╝                               
	                  │                       │               │                                    
	                  │              ╔════════╧═════════════╗ │                                    
══════════════════════╪══════════════╣ This is a separation ╠═╪════════════════════════════════════
	                  │              ╚════════╤═════════════╝ │                                    
	                  │                       │               │                                    
	                  │            Yes it works!              │                                    
	                  │──────────────────────────────────────>│                                    
	                  │                       │               │                                    
	                  │                       ╔══════════════╗│────┐                               
	                  │                       ║this is      ░║│    │ working in progress           
	                  │                       ║another note  ║│<───┘                               
	                  │                       ╚══════════════╝│                                    
	                  │                       │               │─ ─ ┐                               
	                  │                       │               │    | working in progress           
	                  │                       │               │< ─ ┘                               
	                  │                       │               │                                    
	                  │                 done  │               │                                    
	                  │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │                                    
	                  │                       │               │                                    
	 ╔══════╤═════════╪═══════════════════════╪═══════════════╪════════════╗                       
	 ║ OPT  │  dummy comment                  │               │            ║                       
	 ╟──────┘         │                       │               │            ║                       
	 ║                │                       │               │            ║                       
	 ║                │               Error   │               │            ║                       
	 ║                │               On      │               │            ║                       
	 ║                │               Several │               │            ║                       
	 ║                │               Line    │               │            ║                       
	 ║                │──────────────────────────────────────>│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │            ║                       
	 ╠════════════════╪═══════════════════════╪═══════════════╪════════════╣                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ╠════════════════╪═══════════════════════╪═══════════════╪════════════╣                       
	 ║ [other]        │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                    ╔══╧═══════════════╧══╗         ║                       
	 ║                │                    ║This is a long note ░║         ║                       
	 ║                │                    ║over Alice and Last  ║         ║                       
	 ║                │                    ╚══╤═══════════════╤══╝         ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ╚════════════════╪═══════════════════════╪═══════════════╪════════════╝                       
	           ┌──────┴──────┐              Alice           ┌─┴──┐                                 
	           │Bob on       │               ┌─┐            │Last│                                 
	           │several lines│               ║"│            └────┘                                 
	           └─────────────┘               └┬┘                                                   
	                                         ┌┼┐                                                   
	                                          │                                                    
	                                         ┌┴┐                                                   

 

 

Same example using Unicode

	                                         ┌─┐                                                   
	                                         ║"│                                                   
	                                         └┬┘                                                   
	           ┌─────────────┐               ┌┼┐                                                   
	           │Bob on       │                │             ┌────┐                                 
	           │several lines│               ┌┴┐            │Last│                                 
	           └──────┬──────┘              Alice           └─┬──┘                                 
	                  │        hello          │               │                                    
	                  │──────────────────────>│               │                                    
	                  │                       │               │                                    
	                  │                       │ ╔═════════════╧══╗                                 
	                  │                       │ ║this is a note ░║                                 
	                  │                       │ ╚═════════════╤══╝                                 
	                  │Is it ok               │ ╔═════════════╧════╗                               
	                  │with a message that is │ ║This other note  ░║                               
	                  │on several lines?      │ ║should work       ║                               
	                  │<──────────────────────│ ║on several lines  ║                               
	                  │                       │ ╚═════════════╤════╝                               
	                  │                       │               │                                    
	                  │              ╔════════╧═════════════╗ │                                    
══════════════════════╪══════════════╣ This is a separation ╠═╪════════════════════════════════════
	                  │              ╚════════╤═════════════╝ │                                    
	                  │                       │               │                                    
	                  │            Yes it works!              │                                    
	                  │──────────────────────────────────────>│                                    
	                  │                       │               │                                    
	                  │                       ╔══════════════╗│────┐                               
	                  │                       ║this is      ░║│    │ working in progress           
	                  │                       ║another note  ║│<───┘                               
	                  │                       ╚══════════════╝│                                    
	                  │                       │               │─ ─ ┐                               
	                  │                       │               │    | working in progress           
	                  │                       │               │< ─ ┘                               
	                  │                       │               │                                    
	                  │                 done  │               │                                    
	                  │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │                                    
	                  │                       │               │                                    
	 ╔══════╤═════════╪═══════════════════════╪═══════════════╪════════════╗                       
	 ║ OPT  │  dummy comment                  │               │            ║                       
	 ╟──────┘         │                       │               │            ║                       
	 ║                │                       │               │            ║                       
	 ║                │               Error   │               │            ║                       
	 ║                │               On      │               │            ║                       
	 ║                │               Several │               │            ║                       
	 ║                │               Line    │               │            ║                       
	 ║                │──────────────────────────────────────>│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │            ║                       
	 ╠════════════════╪═══════════════════════╪═══════════════╪════════════╣                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ╠════════════════╪═══════════════════════╪═══════════════╪════════════╣                       
	 ║ [other]        │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                    ╔══╧═══════════════╧══╗         ║                       
	 ║                │                    ║This is a long note ░║         ║                       
	 ║                │                    ║over Alice and Last  ║         ║                       
	 ║                │                    ╚══╤═══════════════╤══╝         ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ║                │                       │               │            ║                       
	 ║                │                 None  │               │            ║                       
	 ║                │<──────────────────────────────────────│            ║                       
	 ╚════════════════╪═══════════════════════╪═══════════════╪════════════╝                       
	           ┌──────┴──────┐              Alice           ┌─┴──┐                                 
	           │Bob on       │               ┌─┐            │Last│                                 
	           │several lines│               ║"│            └────┘                                 
	           └─────────────┘               └┬┘                                                   
	                                         ┌┼┐                                                   
	                                          │                                                    
	                                         ┌┴┐                                                   

This page is generated once per day from the wiki content.