Is it possible to put the text on the left side of the arrow?

+2 votes
asked May 3, 2013 in Wanted features by anonymous

Hi,

I have a state diagram.

Example:

State1 -down->  State2: goes to

now I will get in the png-picture - pipe symbol meaning the down arrow:

state1 | goes to state2

Can I have

state1 goes to | state2

I have tried and searched but without success.

I do not mean notes. I know it is possible with notes.

Thank you in advance.

Best regrads,

Klaus

 

 

 

1 Answer

0 votes
answered May 3, 2013 by plantuml (279,680 points)
Unfortunatly, PlantUML is using Graphviz/Dot for that.

And I don't think that it is possible to change label position in edges.
(More info on http://www.graphviz.org/doc/info/attrs.html )

digraph G {
    a -> b [label="foo"]
}

http://www.plantuml.com/plantuml/img/IybCBqeio51mLwZcvL80WaG5NJk598NedCIar1nRfRJyVALONgvQ0000

If someone succeeds in changing the label with Graphviz/Dot, please post here.

Regards,

Arnaud
commented Mar 4, 2014 by duedl0r (100 points)
http://stackoverflow.com/a/4636023/677056

maybe you could add functionality to use headlabel/labeldistance/labelangle?
commented Mar 4, 2014 by plantuml (279,680 points)
Thanks for your idea.
Unfortunatly, labelangle does not apply to label, only to headlabel/taillabel.
( http://stackoverflow.com/questions/2350617/how-to-place-edge-labels-on-edge-in-graphviz )

See here an example:

digraph G {
    a -> b [label="foo", headlabel = "1", labelangle=20]
    a -> c [label="foo", headlabel = "1", labelangle=-20]
}

http://www.plantuml.com/plantuml/png/IybCBqeio51mLwZcKW22H0LTEuKaXUYSnAJK75kbjFny9Hs5ZDJ45B20Wgs2aY5G0Cn9p4lFIRKrCeX5Q4mcGQCkI6Sj0000

A trick could indeed to use headlabel and to automatically compute a "labeldistance".
It's possible to do that on manual edited dot file, but on an generated file, that's another story.
So we are still looking for something here.
commented Mar 23, 2017 by stephan (270 points)
according to this stackoverflow contribution http://stackoverflow.com/questions/18515529/graphviz-place-edge-label-on-the-other-side-ii

it seems possible to add this using the xlabel feature of current graphviz

essential parts copied from the reference:
Graphviz Graph with arrow-text-anchor changed

digraph {
forcelabels=true;

    0:sw -> 1:nw [ dir=forward, xlabel="  (1, 0)  "];
    0 -> 1 [dir=none];
    1:ne -> 0:se [ dir=backward, xlabel= "  (0, -1)  "];

}
you need graphviz version >2.29 to use xlabel.
commented Jan 23, 2019 by anonymous
This would be great if it were possible (start using xlabel).
commented Jul 23 by setop (300 points)
could be a skin param ...
...