Component Diagrams: please add link direction/type token into the id of the corresponding SVG path

+1 vote
asked Aug 5 in Wanted features by boshka (2,740 points)
edited Aug 5 by boshka

Could you add link direction/type token into the id the corresponding path of the SVG output?

Here is the example:

@startuml
    component a as a {
    }
    component b as b {
    }

    a->b: test
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKhEpot8pqlDAr58L4Wi1XBLNBL8WaaWmIIm85UYhbsIbK99Qd49bqDgNWfGDm00

In the svg source, I would like to see the path tag with the following id: id="a->b"

instead of: id="a-b"

Also, if the link in .puml code is, say, "a -o b", the id in the svg should be "a-ob"

So, basically I propose to pick the link notation from .puml code and put it as is into the id of the corresponding path tag in the svg. Could this enhancement be added, please?

This will help identifying directions and arrow types (i.e. components relationships) directly from the SVG source

1 Answer

0 votes
answered Aug 6 by plantuml (206,820 points)
Ok, in last beta http://beta.plantuml.net/plantuml.jar we have changed the uid to id="a->b".

Is it working for you ?

We still have to manage "o" and other decoration.
commented Aug 7 by boshka (2,740 points)
Looks ok, now. I'll let you know if notice anything else.

BTW, how it will currently behave in case there is decoration other than < or >?

i guess for now it would be best to always map all others, like "-o" and "o-" etc. to "->" and "<-" correspondingly. What do you think?
commented Aug 7 by plantuml (206,820 points)
Right now we stick to -> and <- because it's easier for us, even for other decorations.

Just tell us if it's not ok for you. Thanks!
commented Aug 8 by boshka (2,740 points)
edited Aug 8 by boshka

ok, then, what I see currently, for example, for the following puml code:

a 0-[dashed]--0 b
or
a 0--0 b
or
a 0-0 b
or
a o-o b
etc. (and, probably, etc with other decorations)

there will be wrong direction info in the id:

id="a->b"

(should be just "a-b", since the above puml code examples mean it is a bidirectional link/relationship)

commented Aug 8 by plantuml (206,820 points)
Right, this is fixed in last beta http://beta.plantuml.net/plantuml.jar

Thanks for your tests!
commented Aug 8 by boshka (2,740 points)
Many thanks! Looks ok so far. Will let you know if I see something wrong.
...