If two entities are exactly or roughly above each other, a connecting relationship runs through the lowest entity's box.
This would also apply for relationships between an entity and itself (e.g. parent to child relations in a hierarchy of Nodes).
Suggestion and Example
If EntityL is on the left and EntityR is clearly on the right, the rendering of the relationship connects EntityL.rightSide to EntityR.leftSide. This if fine.
But if EntityB is on the bottom and EntityT is on the top (but not clearly on the left or right), relationships should not connect EntityB.rightSide to EntitiyT.leftSide (or vice versa). Instead, it would be nicer to connect EntityB.rightSide and EntitiyT.rightSide (or EntityB.leftSide to EntityT.leftSide).
How to detect this? If the two boxes' x-ranges overlap.
How to choose which side? Choose the side with least amount of existing connections at that time (summed over both entities). In the example below, the connection between the two blue entities would then be on the right side rather than the left side. Global optimisation of avoiding crossing relationships might be possible, but require more work.
Problem
If two entities are exactly or roughly above each other, a connecting relationship runs through the lowest entity's box. This would also apply for relationships between an entity and itself (e.g.
parent
tochild
relations in a hierarchy ofNodes
).Suggestion and Example
If
EntityL
is on the left andEntityR
is clearly on the right, the rendering of the relationship connectsEntityL
.rightSide
toEntityR
.leftSide
. This if fine.But if
EntityB
is on the bottom andEntityT
is on the top (but not clearly on the left or right), relationships should not connectEntityB
.rightSide
toEntitiyT
.leftSide
(or vice versa). Instead, it would be nicer to connectEntityB
.rightSide
andEntitiyT
.rightSide
(orEntityB
.leftSide
toEntityT
.leftSide
).How to detect this? If the two boxes' x-ranges overlap.
How to choose which side? Choose the side with least amount of existing connections at that time (summed over both entities). In the example below, the connection between the two blue entities would then be on the right side rather than the left side. Global optimisation of avoiding crossing relationships might be possible, but require more work.