Overlapping Arrows in Class Diagram

0 votes
asked Mar 25, 2022 in Bug by jens.fudickar (380 points)

Hi,

generating the following diagram I got overlapping arrows.

I know that I can change the order or try a left / right / up / down.
The problem is that the image is generated out of a JSON file autoamtically.
It would be good to find something which is automatable.

Any ideas how to prevent this.

Regards

Jens


@startuml


legend
| <b>json2puml | <b>v1.1.5.15\n |
| Generated at | 25.03.2022 09:33:33 |
| Definition File | json2pumldefinition.json |
| Input List File | samples\\tmf\\json2pumlinputlist.json |
| Definition Option | product |
end legend

together {
  class "<u>product</u> <i>700000000000084329</i>\l<b>Red Internet 50 Cable</b>" as 700000000000084329
  class "<u>productTerm</u> <b>9b3bfcb6-c63b-4e04-a539-08c766e6ade8</b>" as productTerm_700000000000084329_4
}

class "<u>product</u> <i>700000000000084329</i>\l<b>Prod a</b>" as 700000000000084329 << (P,Green) product >> {
|= attribute |= value |
| id | 700000000000084329 |
| status | active |
}
class "<u>product</u> <i>700000000000084452</i>\l<b>Prod b</b>" as 700000000000084452 << (P,Green) product >> {
|= attribute |= value |
| id | 700000000000084452 |
| status | active |
}
class "<u>product</u> <i>700000000000084453</i>\l<b>Prod c</b>" as 700000000000084453 << (P,Green) product >> {
|= attribute |= value |
| id | 700000000000084453 |
| status | active |
}
class "<u>product</u> <i>700000000000084551</i>\l<b>Prod d</b>" as 700000000000084551 << (P,Green) product >> {
|= attribute |= value |
| id | 700000000000084551 |
| status | active |
}
class "<u>product</u> <i>700000000000084719</i>\l<b>Prod e</b>" as 700000000000084719 << (P,Green) product >> {
|= attribute |= value |
| id | 700000000000084719 |
| status | active |
}
class "<u>productTerm</u> <b>9b3bfcb6-c63b-4e04-a539-08c766e6ade8</b>" as productTerm_700000000000084329_4 << (P,Green) product >> {
|= attribute |= value |
| name | 9b3bfcb6-c63b-4e04-a539-08c766e6ade8 |
}
700000000000084329 -[#green,dashed]-> 700000000000084329:productRelationship\ltype.: subscriptionRelation
700000000000084329 -[#orange,dashed]-> 700000000000084452:productRelationship\ltype.: OrderItem
700000000000084329 -[#orange,dashed]-> 700000000000084453:productRelationship\ltype.: OrderItem
700000000000084329 *--> productTerm_700000000000084329_4:productTerm\ltype.: COMMITMENT
700000000000084452 -[#green,dashed]-> 700000000000084329:productRelationship\ltype.: subscriptionRelation
700000000000084453 -[#green,dashed]-> 700000000000084329:productRelationship\ltype.: subscriptionRelation
700000000000084453 -[#blue,dashed]-> 700000000000084452:productRelationship\ltype.: dependsOn
700000000000084453 -[#blue,dashed]-> 700000000000084719:productRelationship\ltype.: dependsOn
700000000000084551 -[#gold,dashed]-> 700000000000084329:productRelationship\ltype.: commercialRelation
700000000000084551 -[#green,dashed]-> 700000000000084329:productRelationship\ltype.: subscriptionRelation
700000000000084551 -[dashed]-> 700000000000084453:productRelationship\ltype.: enabledBy

@enduml

commented Mar 25, 2022 by jens.fudickar (380 points)
I'm talking only about the two horizontal lines between the two products.

1 Answer

0 votes
answered Mar 25, 2022 by The-Lu (64,760 points)

Hello J.,

  • Is the `together` group mandatory?

Here is an attempt without:

Then just change this line:

700000000000084329 *-u-> productTerm_700000000000084329_4:productTerm\ltype.: COMMITMENT

If that can help,
Regards.

commented Mar 25, 2022 by jens.fudickar (380 points)
No, the together is mandatory.
It's part of a bigger example.
And adding the -u- is also not so simple, as I said the code is generated, for that I would like to find a rule :-)
commented Mar 25, 2022 by jens.fudickar (380 points)

And with simple examples like this:

@startuml


class a {
  name=a
  }
class b {
  name = b
  }

a -l-> b: comment 1
b --> a: comment 2


@enduml

it's working without any problems.

commented Mar 25, 2022 by The-Lu (64,760 points)

Hello J.,

In fact the big issue come from the `together`.

And there is also other arrows on your case, as:

If that can help,
Regards.

commented Mar 25, 2022 by The-Lu (64,760 points)

Hello J.,

I understand your constraint about the mandatory `together`. 

Then, another workaround is to change the layout, as:

left to right direction

Here is the result:

But there is the same defect on the middle of the diagram! sad

If that can help,
Regards.

commented Mar 25, 2022 by jens.fudickar (380 points)
I also tested the left to right before :-(
So than I have to see it as a bug and hope that it got fixed sometimes. :-)

It's not a major problem, as it is not happening too often.
commented Mar 25, 2022 by The-Lu (64,760 points)

Then another workaround is to change the layout engine, as:

!pragma layout elk

See the result here:

See doc. here:

If that can help,
Regards.

commented Mar 25, 2022 by jens.fudickar (380 points)
This may help, but I believe on our confluence the elk jar is not installed.

And I have to check it on the bigger files.
...