"Ghost links" between diagrams

0 votes
asked Apr 16, 2020 in Bug by Soeren

Hi,

I've found some "weird behavior"  with link creation.

Without connecting two entities, plantuml creates a "ghost Link" object whenever at least 3 diagrams (type does not matter) are added without adding a connection between them. This is not visible for most export types (since some values of that <Link> object are null when debugging), but you can make it visible by exporting e.g. as ASCII. The Link is also not declared as invisible or removed or something else.

Reproduce:
Input is just 3 objects, png (1) looks ok. The ASCII art (2) export has ghost connections between o1--o2 and o1--o3. When debugging now the List<Link> has two entries but should have none.

When we add a connection before we add the third UML object (3) the ghost connections vanish also from ASCII Art  (4). When debugging now, the List<Link> has one entry (o1--o2) which is correct.

(1) http://www.plantuml.com/plantuml/uml/FOun3iCW54DtJk4j4qEI2-GgX7mLAl2Noa_Ru-TFR4-o_EnZMFhOtLlGyotPeEkaBImti_OkD53-XbOfC4KJWnN1g-WmP2MzK9K3fzXFXAw9KJSaNkvntF5DhAE4HLV42C_cpXuEuUKV7W00

(2) http://www.plantuml.com/plantuml/txt/FOun3iCW54DtJk4j4qEI2-GgX7mLAl2Noa_Ru-TFR4-o_EnZMFhOtLlGyotPeEkaBImti_OkD53-XbOfC4KJWnN1g-WmP2MzK9K3fzXFXAw9KJSaNkvntF5DhAE4HLV42C_cpXuEuUKV7W00

(3) http://www.plantuml.com/plantuml/uml/FOun3iCW54DtJk6j4qEI2-GgX7mLAl2NYjFs-6NAzkJX-Ur3wQshj-37oxBWoqrhU5pCthjHeFs4LccGevcWOdWM7q9sqhAgS-0mVSquDJ7wYiHpUYPk-2JMKO8lY75kk6-si1lFcV07

(4) http://www.plantuml.com/plantuml/txt/FOun3iCW54DtJk6j4qEI2-GgX7mLAl2NYjFs-6NAzkJX-Ur3wQshj-37oxBWoqrhU5pCthjHeFs4LccGevcWOdWM7q9sqhAgS-0mVSquDJ7wYiHpUYPk-2JMKO8lY75kk6-si1lFcV07

BR,

Sören

1 Answer

0 votes
answered Apr 16, 2020 by plantuml (252,860 points)
Thanks for the report.

There is indeed an issue with txt export in that case, we are going to fix it.

Explanation of this behavior : when people put a lot of objects without any links, GraphViz uses some horizontal layout behaviour. To force a more compact layout, PlantUML silently adds some "ghost" links between objects. Those links are supposed not to be printed (in PNG for example). As you figure out, those links are wronly displayed with txt export.
commented Apr 16, 2020 by Soeren
Great. Thanks for the explanation why it is added.
commented Apr 16, 2020 by plantuml (252,860 points)
This is fixed in last beta http://beta.plantuml.net/plantuml.jar and on the online server http://www.plantuml.com/plantuml/txt/SoWkIImgAStDuSfFoafDBb78DuIpZE0iOow7rBmKe2e0

Note that support for ASCII art is only partial : do not hesitate to post issue. Even if ASCII art is not a top priority for us, we might try to improve things on this site :-)
...