Closed jbeard4 closed 8 years ago
One option is to add ports to the parent node a
that serve as explicit entry and exit points, say p_in
and p_out
. Then add two edge a2 -> a:p_out
and a:p_out -> a:p_in
. From the layout algorithm's perspective the latter is a self loop.
This issue has been resolved. Thank you for your help.
Hello,
I am trying to find a way to prompt klay to layout an edge that originates in a parent node and targets a descendant node, such that the edge exits and re-enters the parent node.
My use case is as follows. In the Statecharts formalism, there are two varieties of transitions: internal and external. This distinction is relevant when a transition originates from a parent state and targets a substate. The difference between these two transition types, semantically, is that when a transition is taken, an external transition causes the source state to be exited and re-entered, while the internal transition does not cause the source state to be exited.
I have found that the KlayJS default layout works very well for internal transitions:
I have tried to force klay to exit the parent node by creating an invisible "pseudonode" with width and height 0, however this results in a graphical artifact, as a bend point is created which overlaps with the edge originating from the pseudonode. You can see the results below:
Input KGraph JSON:
Kgraph after layout:
I was wondering if there is a better way to use the klay API to support this use case? Thank you for your guidance on this.