Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How to insert a minimum horizontal space between 2 participants or 2 groups in a sequence diagram

0 votes

In my sequence diagram I am using par2 to show the parallel execution of 2 loops in different CPU cores, but the 2 loop boxes are overlapping, and the graphical result is poor, and hard to read:

@startuml

box "group 1" #lightblue
    Participant P1
    Participant P2
end box
' I would like to insert an horizontal minimu space constraint here
box "group 2" #lightgreen
    Participant P3
    Participant P4
end box

par2
    loop forever
        P1 -> P2
        P2 --> P1
        end
else
    loop forever
        P3 -> P4
        P4 --> P3
    end
end
@enduml

 

asked Apr 12 by PascalChap (150 points)

1 Answer

0 votes
 
Best answer
Hello, 
Start with the following:
 
@startuml
skinparam BoxPadding 30
 
Hope this helps
answered Apr 12 by Serge Wenger Work (3,940 points)
selected Apr 12 by PascalChap
Thanks for answering. Unfortunately, it has no effect in this case (I am using the 2017.10 version)
Very strange, because it is working with version 2017.09 (on the web site) and 2017.10 locally:

@startuml
skinparam BoxPadding 40

box "group 1" #lightblue
    Participant P1
    Participant P2
end box
' I would like to insert an horizontal minimu space constraint here
box "group 2" #lightgreen
    Participant P3
    Participant P4
end box

par2
    loop forever
        P1 -> P2
        P2 --> P1
        end
else
    loop forever
        P3 -> P4
        P4 --> P3
    end
end
@enduml
You are right, it works :o). I was testing the code using the diagram plugin for sublime, and it was using a "hidden" copy of plantuml version 8024.
I modified the python code to remove the version test and it is ok now, both when invoking directly plantuml from windows or from the plugin.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...