Line text far from line end

0 votes
asked Jun 10, 2022 in Question / help by Canellas (170 points)

In the diagram below, "1 (url)", "3 (bla ok)" and "4 (argh)" are texts at the end of lines that arrive in A, are too far from the end of its respective lines.

Is it possible to make them stay close to the line end? 

@startuml

skinparam linetype ortho
skinparam nodesep 120

 

cloud F
actor G

node H {
    package A <<program>> {
        component B <<lib>>
    }

    package C <<program>>

    package D <<program>> {
        component E <<lib>>
    }
}

A -[bold,#green]- "2 (bla)" F

F -[bold,#green]- "3 (bla ok)" A 

G -[bold,#green]- C

A "4 (argh)" -[bold,#red]- C

E  -[bold,#blue]- "1 (url)" A
@enduml


Thanks!

commented Jun 10, 2022 by The-Lu (64,340 points)

Hello C.,

From:

A possible workaround is to use ELK, adding:

!pragma layout elk

As:

But there are some other issues with up line from A and up line from C...

See doc. here:

Regards.

commented Jun 10, 2022 by The-Lu (64,340 points)

Here is another proposal, as:

@startuml
left to right direction 
skinparam linetype ortho
'skinparam nodesep 120

actor G
node H {
    package A <<program>> {
        component B <<lib>>
    }

    package C <<program>>

    package D <<program>> {
        component E <<lib>>
    }
}
cloud F

A -[bold,#green]- "2 (bla)" F
F -[bold,#green]- "3 (bla ok)" A 
G ---- C
A "4 (argh)" -[bold,#red] C
E  -[bold,#blue]d- "1 (url)" A
@enduml

Regards.

commented Jun 13, 2022 by Martin (8,360 points)

@PlantUML

When I use "!pragma svek_trace on" on the OP's diagram, I get the following dot file:

This explains why the OP's arrow texts are in the positions they are... the labels are positioned around the point node that has been added to package A.

But perhaps you can explain something I've never understood - why do you not use "compound=true" with "lhead" and "ltail" in these diagrams?  And how does Plantuml get the arrows to truncate at the cluster edges without these additional attributes?

Here's a mock-up of the same diagram but with some lhead and ltail attributes added:

You can now see the 'point' shape (zacl0005) that has been added to package "A", as all the arrows to/from it now start/end at the cluster edge.  And the text labels have moved to the cluster edge, where the OP expects them.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...