Node-style edge labels for component diagrams (`-[node]->` and `componentDiagramEdgeLabelStyle`)

0 votes
asked 19 hours ago in Wanted features by dmf19 (1,840 points)

State diagrams already support node-style edge labels (-[node]->, or skinparam stateDiagramEdgeLabelStyle node). With that style the label is drawn as a node spliced into the link, so Graphviz makes room for it. Component diagrams don't have this. Their labels are placed on the line and, in busy diagrams, often overlap other edges, components or each other. With many labelled links it can be hard to tell which label belongs to which link (see #1783).

It would help to have the same option for component diagrams.

Per link:

@startuml
component Client
component Server
database DB

Client -[node]-> Server : request / auth
Server --> DB : query
@enduml

For the whole diagram, with a per-link opt-out:

@startuml
skinparam componentDiagramEdgeLabelStyle node
component Client
component Server
database DB

Client --> Server : request / auth
Server -[nonode]-> DB : query
@enduml

-[nonode]-> would also fix a related problem in state diagrams. Right now there is no way to opt one transition out when stateDiagramEdgeLabelStyle node is set. -[nonode]-> doesn't parse at all, and the line fails with Syntax Error? (Assumed diagram type: ...).

Arrow decorations, direction (-up->, -left-> …) and hidden links should behave as they do today.

I have an implementation with Vega tests ready and will open a PR referencing this post.

Related:

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.
...