Sequence Diagram participantactor name with newline on PlantUML - Stack Overflow

How to use a newline in a sequence diagram participantactor name ?It would be particularly useful w

How to use a newline in a sequence diagram participant / actor name ? It would be particularly useful when you have a long name like this:

 ┌───┐          ┌─────────────────┐
 │Bob│          │VeryLongAliceName│
 └─┬─┘          └────────┬────────┘
   │       hello         │         
   │────────────────────>│         
 ┌─┴─┐          ┌────────┴────────┐
 │Bob│          │VeryLongAliceName│
 └───┘          └─────────────────┘

I'd like to have it like this:

                ┌─────────┐
 ┌───┐          │VeryLong │
 │Bob│          │AliceName│
 └─┬─┘          └────┬────┘
   │     hello       │     
   │────────────────>│     
 ┌─┴─┐          ┌────┴────┐
 │Bob│          │VeryLong │
 └───┘          │AliceName│
                └─────────┘

How to use a newline in a sequence diagram participant / actor name ? It would be particularly useful when you have a long name like this:

 ┌───┐          ┌─────────────────┐
 │Bob│          │VeryLongAliceName│
 └─┬─┘          └────────┬────────┘
   │       hello         │         
   │────────────────────>│         
 ┌─┴─┐          ┌────────┴────────┐
 │Bob│          │VeryLongAliceName│
 └───┘          └─────────────────┘

I'd like to have it like this:

                ┌─────────┐
 ┌───┐          │VeryLong │
 │Bob│          │AliceName│
 └─┬─┘          └────┬────┘
   │     hello       │     
   │────────────────>│     
 ┌─┴─┐          ┌────┴────┐
 │Bob│          │VeryLong │
 └───┘          │AliceName│
                └─────────┘
Share Improve this question edited Nov 18, 2024 at 7:28 Geert Bellekens 13.8k3 gold badges29 silver badges55 bronze badges asked Nov 16, 2024 at 10:49 pochopsppochopsp 1,0531 gold badge10 silver badges24 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Just wrap your participant name in double quotes ", then you can use the newline escape sequence \n to break the name in two lines, like this:

@startuml
Bob -> "VeryLong\nAliceName": hello
@enduml

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745660506a4638806.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信