Plantuml generates SVG with not unique element ids

0 votes
asked Mar 18, 2019 in Bug by boshka (3,940 points)
edited Mar 19, 2019 by boshka

Please have a look:

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

in the svg source, you will see 2 path tags with the same ids: id="a-b":

view-source:http://www.plantuml.com/plantuml/svg/SoWkIImgAStDuKhEpot8pqlDAr58L4Wi1XBLNBL8WaaWmIIm85UYhbsIbK99Qd49LwADBfIfK9HQ35HRdChba9gN0ZGH0000



Well, yes, i know that I can put in the code "b->a: test response" instead of "a<-b: test response" for a proper result (different ids). However, my "reverse" syntax is valid too, so, the not uniqueness should be fixed as a defect. A way to fix would be:

1. for forward links do ids as: "a-to-b"

2. for backward links do ids as "a-from-b"

3. for not directed links, probably you can leave the ids as is or make those as follows "a-nodir-b"

4. for bidirectional links make ids as "a-bidir-b"

Additionally, could you consider adding the following simple capability: http://forum.plantuml.net/9195/provide-ability-state-interfaces-passed-elements-classes

1 Answer

0 votes
answered Mar 21, 2019 by plantuml (295,000 points)
Thanks for the feedback.

This should be fixed in last beta http://beta.plantuml.net/plantuml.jar

Tell us if it's not working for you.
commented Mar 21, 2019 by boshka (3,940 points)
edited Mar 26, 2019 by boshka
thank you! though indexes (the way you fixed it) are much less informative and such ids can't be easily predicted (compared to the approach, proposed by me), so, it wont be possible to predict and get element by such id...
Also, it would be really good to have a hint about the link direction (association info) within the IDs. Would you please consider my approach for the fix instead?

Also, how about the request to add classes? It looks simple and will help greatly building dynamic svgs (driven by javascript):
http://forum.plantuml.net/9195/provide-ability-state-interfaces-passed-elements-classes
...