Can I set a default line spacings between messages?

0 votes
asked Sep 21 in Question / help by anonymous
Hello,

My question is regarding a sequence diagram in PlantUML. Given that there is more than 1 message, I was wondering if I could set a default spacing between all messages (all elements even) using skniparam or another command.

There's an operator: "|||" which does this between each element. But it's not quite nice to add ||| in each line such as follows:

@startuml
participant S
participant T
participant A
participant SS

|||

SS -> A: Message1

|||
A -> T: Message 2

|||
T -> S: Message 3

|||
@enduml

And so, it would be really great if there's a command that can alter this spacing distance as default.

(I don't really like the default spacing distance between elements that PlantUML provides)

Thank you.

1 Answer

0 votes
answered Sep 23 by The-Lu (74,900 points)

Hi A.,

Here is a workaround:

  • You can perhaps use the preprocessing engine and a procedure for that.
Regards,
Th.

commented Sep 23 by anonymous
Could you please explain a bit on that? That's something new. I would like it to work on the browser -on the go- diagrams as well and I'm not very familiar with the tool.
commented Sep 24 by The-Lu (74,900 points)
edited Sep 24 by The-Lu

Hi A.,

Here is a proposal, using procedure as:

@startuml
participant S
participant T
participant A
participant SS

!procedure $seq($s, $d, $m)
  |||
  $s -> $d: $m
!end procedure

$seq(SS, A, "Message 1")
$seq(A, T, "Message 2")
$seq(T, S, "Message 3")

@enduml

Enjoy,

Regards,
Th.

commented Sep 24 by anonymous
Thank you very much. I didn't even know functions could be used. I would greatly appreciate it if you could share any relevant documents on these types of stuff.
commented Sep 24 by The-Lu (74,900 points)

You can read the doc. here:

...