最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Sequence Diagram participantactor name with newline on PlantUML - Stack Overflow

programmeradmin2浏览0评论

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
发布评论

评论列表(0)

  1. 暂无评论