Plantuml draw odd line

0 votes
asked Jul 1, 2021 in Wanted features by Xian (120 points)
Hello PlantUML,

i am new here in this forum, but i used PlantUML since a long time. It is a great tool to draw UML diagram.

I am wondering, if it is possible to draw a odd line in sequence diagram.

Thanks a lot!
commented Jul 1, 2021 by The-Lu (63,920 points)

Hello X.,

What do you means by a odd line, in sequence diagram?
Could you precise?

Regards,
Th.

1 Answer

0 votes
answered Jul 1, 2021 by The-Lu (63,920 points)

Hello X.,

If you think of imperfect line or handwritten, yes, you can, but for all the sequence diagram, not for a specific arrow, as:

@startuml
skinparam handwritten true

Alice -> Bob : hello
note right: Not validated yet
Alice <- Bob : hello
@enduml

See also doc. here:

If that can help,
Regards,
Th.

commented Jul 1, 2021 by Xian (120 points)
Hello Th.,

thank you very much for your quick reply.

i mean a line like this:

https://www.websequencediagrams.com/cgi-bin/cdraw?lz=CgpBLT4oMilCOiB0ZXh0Cg&s=rose
commented May 10, 2022 by Andy (160 points)

Hello Xian, hi The-Lu,

I´m also very interested in the feature diagonal/crossing/odd arrows in sequence diagrams. This topic was asked serval times in Questions / Help section.

Instead of raising a new feature request for the same topic may I ask you.

  • Is there a solution there?
  • If not, is it on the road map?

Thanks much for your answer

commented May 10, 2022 by plantuml (294,960 points)
Hi all,

It's something we could work on.

The first question is about the syntax: any idea about a nice, logical and simple syntax for this feature? This may be the most difficult point about this request feature.
commented May 10, 2022 by The-Lu (63,920 points)

Hello all, and PlantUML team,

Like similar another sequence diagram tools test or documentation...


Websequencediagrams
Link:

title Test 
A ->(1) B: text 1
A ->(5) B: text 5
A ->(10) B: text 10


Mscgen
Link:

arcgradient
This causes message arcs to slope down the page rather than running horizontally.
The value given is the number of pixels below the start of the message arc that the end of the arc should meet the target entity.

arcskip
This offsets the vertical position at which an arc reaches its destination entity.


Msc-generator

Link:

Angle
You can use the ‘angle’ chart option (or attribute) to make the arrows slanted. Simply
specify a value in degrees. Note that bi-directional arrows will not be slanted.

This takes a number in degrees and makes the arrow slanted. Arrows pointing
to the same entity cannot have such an attribute. This attribute takes its
default value from the angle chart option (or is zero in the absence of such an
option, which corresponds to horizontal arrows).

Specifies the default value for arrow slanting. Its value is measured in degrees,
can take values from 0 to 45 degrees and its default value is zero.

Slant_depth
This is similar in effect to the angle attribute, but instead of specifying the
angle of the slant in degrees, you can use this attribute to specify how many
pixels shall the end of the arrow be below the start of it. If you specify both
the angle attribute and slant_depth the latter takes effect.


Other tools...

See other similar tools...


Proposal for PlantUML
Then, for PlantUML, perhaps we can create a local style element named `angle` for `arrow` element, here is a proposal, as:

<style>
arrow {
  angle 5
}
</style>

or locally the websequencediagrams syntax...

To debate...

commented May 10, 2022 by Andy (160 points)
Hello plantuml team hi The-Lu and thanks for your proposals,

honestly I would go for the solution from www.websequencediagrams.com

A ->(1) B: text 1
A ->(5) B: text 5
A ->(10) B: text 10

Why? You could decide on element level (=arrow) if a slope should be applied for this single element or not.

Introducing a skinparameter e.g. "arcgradient" will impact all arrows in diagram.

As far as I know arrows are no dedicated elements like participants or actors. I.e. also a <style></style> does not help us here.

Honestly I´m thankful for every kind of solution. :-)
commented May 13, 2022 by Andy (160 points)
Dear platuml core team,

since there is again progress on this this topic, lets continue and find a solution. Having the possibility to draw odd/diagonal lines with plantuml like with other tools would be really great.

Thanks much
commented May 17, 2022 by plantuml (294,960 points)

This is really a test feature, the drawing is not perfect yet, but the online server allow this:

@startuml
participant A
participant B

A ->(1) B: text 1
A ->(5) B: text 5
A ->(10) B: text 10
A ->(20) B: text 20
@enduml

Honestly, we really don't like the syntax :-)

The number is not an angle but a number of pixels.

Is this what you are looking for?

Thanks

commented May 17, 2022 by The-Lu (63,920 points)

Hello all,

Good, it a good begin... cheeky
And here are some tests...

@startuml
participant A
participant B

A ->(10) B: text 10
B ->(10) A: text 10

@enduml

  • How to change direction? with negative value?

@startuml
!pragma teoz true
participant A
participant B

A ->(10) B: text 10
& B ->(10) A: text 10

@enduml

See also arrow head:

@startuml
participant A
participant B

A ->(60) B: text 10
B ->(60) A: text 10
@enduml

Then:

Honestly, we really don't like the syntax :-)

IMHO, I would prefer `angle` style param (globaly and localy), as:

@startuml
<style>
arrow {
  angle 10
}
</style>
participant A
participant B

A -> B: text 10
A <- B: text 10
A -> B: text 10
A -> B: text 10

<style>
arrow {
  angle 40
}
</style>
A -> B: text 40
A <- B: text 40
@enduml

Regards,
Th.

commented May 19, 2022 by Andy (160 points)

Dear plantuml, hi The-Lu,

1st of thanks a lot for investing time to bring in that new feature. "Drawing odd lines".

3x Findings on my side

Regarding syntax. <style><style/> or A ->(XX)B. Up to you as long as the slope could be set on per arrow element.

Best regards

@startuml
participant A
participant B

A ->(40) B++: text 1
B -->(20) A--
@enduml

commented May 21, 2022 by plantuml (294,960 points)

Last example is working now online:

Does it sound good?

commented May 23, 2022 by Andy (160 points)

Dear plantuml, hi The-Lu,

how is sounds? I can´t say but it looks incredible yeswink

Out of curiosity are there regular release cycles where such a new feature could go in or when is it possible the this new feature could go to the plantuml.jar? 

Best regards Andy

commented May 23, 2022 by The-Lu (63,920 points)

For that you can take the latest .jar, on:

Regards.

commented May 24, 2022 by The-Lu (63,920 points)
edited May 27, 2022 by The-Lu

Hello PlantUML team,

Here is a new test:

  • Could you allow this syntax also:
@startuml
A ->(10) B: text 10
B ->(10) A: text 10

A ->(10) B: text 10
A (10)<- B: text 10
@enduml

Regards.

commented May 27, 2022 by plantuml (294,960 points)
Last example is now fixed!

Thanks!
commented May 27, 2022 by The-Lu (63,920 points)

Hello PlantUML team,

Thanks a lot, then... here is a new test (I did not test all types of arrows tail-head):

@startuml
a ->>(10) b
a (10)<<- b
@enduml

Thanks for yours works,
Regards.

commented Jun 16, 2022 by Matt Anderson
This no longer appears to work
commented Jun 16, 2022 by The-Lu (63,920 points)

Hello M.,

This is not yet released...
Only on the snapshots after May 17th:

Regards.

...