kieler/klayjs-d3

Connecting ports within a node

Opened this issue · 5 comments

Hi, I want to connect two ports of a node and I need the edge to be inside the node. Is there any way to achieve this ? (apart from creating a dummy child node). Thank you

Currently it is creating an edge outside the node.
1111

There's a layout option for this: de.cau.cs.kieler.selfLoopInside: true. You have to set this for both the containing node and the specific edge that should be routed inside.

Thanks for the reply. But it seems that the option works only if the node has a child.

I tried the following two graphs.
{"children":[{"edges":[{"sourcePort":"node..port2","id":"node..port2->node..port1","text":"port2 is depended on port1","source":"node","type":"dep","targetPort":"node..port1","target":"node","properties":{"de.cau.cs.kieler.selfLoopInside":true}}],"width":40.0,"id":"node","text":"node","ports":[{"id":"node..port1","text":"port1","type":"R","properties":{"de.cau.cs.kieler.portSide":"WEST"}},{"id":"node..port2","text":"port2","type":"P","properties":{"de.cau.cs.kieler.portSide":"EAST"}}],"properties":{"portConstraints":"FIXED_SIDE","de.cau.cs.kieler.selfLoopInside":true},"height":40.0}],"id":"","properties":{"portConstraints":"FIXED_SIDE"}}
1

{"children":[{"edges":[{"sourcePort":"node..port2","id":"node..port2->node..port1","text":"port2 is depended on port1","source":"node","type":"dep","targetPort":"node..port1","target":"node","properties":{"de.cau.cs.kieler.selfLoopInside":true}}],"width":40.0,"id":"node","text":"node","ports":[{"id":"node..port1","text":"port1","type":"R","properties":{"de.cau.cs.kieler.portSide":"WEST"}},{"id":"node..port2","text":"port2","type":"P","properties":{"de.cau.cs.kieler.portSide":"EAST"}}],"children":[{"id":"dummy"}],"properties":{"portConstraints":"FIXED_SIDE","de.cau.cs.kieler.selfLoopInside":true},"height":40.0}],"id":"","properties":{"portConstraints":"FIXED_SIDE"}}
2

Could be expected behavior. @le-cds should be able to answer this.

I believe this is not the case in the Java version. Back then, I had to implement the graph importer to properly handle the case of inside self loops without children. This modification needs to be made in the KLayJS graph importer as well.

Is there any sample for hierarchy with ports?