klayjs-d3 icon indicating copy to clipboard operation
klayjs-d3 copied to clipboard

Connecting ports within a node

Open Prashanth-LakshmiNarasimhan opened this issue 9 years ago • 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.

uruuru avatar Oct 26 '16 10:10 uruuru

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.

uruuru avatar Oct 27 '16 06:10 uruuru

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.

le-cds avatar Oct 27 '16 07:10 le-cds

Is there any sample for hierarchy with ports?

chandusekhar avatar Mar 30 '17 15:03 chandusekhar