Grouping of Nodes using KLay Layered Layout [message #1793847] |
Fri, 17 August 2018 07:32  |
Eclipse User |
|
|
|
Hello ,
I am able to layout my Graphical diagram using KLay Layered Layout.
But I am clueless on how to group some nodes using KLay Layered Layout.
I am attaching a snap on how I would like to see my diagram. Any help to make some progress towards this would be appreciated greatly.
Thank you.
Attachment: Layout.png
(Size: 10.53KB, Downloaded 213 times)
|
|
|
Re: Grouping of Nodes using KLay Layered Layout [message #1793919 is a reply to message #1793847] |
Mon, 20 August 2018 13:27   |
Eclipse User |
|
|
|
Raghu,
what you have there is what we call a hierarchical graph: nodes that contain further nodes. Just like your graph as a whole is represented by a node, its children can in turn contain further nodes. This page explains what I'm talking about.
The solution to your problem would thus be to group your nodes by making them children of additional nodes. Each group would be represented by one node.
One problem is that you have edges that cross groups. Those are not supported out of the box. To have them laid out more or less properly, you have to set the hierarchy handling layout option to INCLUDE_CHILDREN on the parent node.
Hope this helps.
Cheers,
Chris
|
|
|
Re: Grouping of Nodes using KLay Layered Layout [message #1794021 is a reply to message #1793919] |
Wed, 22 August 2018 14:11   |
Eclipse User |
|
|
|
Hello Christoph,
thanks for the reply. Yes it helped me a lot. I am able to make a good progress with your solution. My hierarchical graph looks perfect.
I have to make one last step, i.e, edges across groups. Since I have not migrated to ELK yet, I want to use the Legacy Id: de.cau.cs.kieler.hierarchyHandling. I am not able to find this id. It would be great if you can help me to find this .
Thanks in advance.
|
|
|
Re: Grouping of Nodes using KLay Layered Layout [message #1794095 is a reply to message #1794021] |
Thu, 23 August 2018 12:17   |
Eclipse User |
|
|
|
Raghu Mising name wrote on Wed, 22 August 2018 14:11I have to make one last step, i.e, edges across groups. Since I have not migrated to ELK yet, I want to use the Legacy Id: de.cau.cs.kieler.hierarchyHandling. I am not able to find this id. It would be great if you can help me to find this .
We renamed the setting when we decided to make it more powerful. It used to be a simple boolean setting with the ID de.cau.cs.kieler.layoutHierarchy. Simply set it to true on the root node and you should be good to go.
Cheers,
Chris
|
|
|
Re: Grouping of Nodes using KLay Layered Layout [message #1794606 is a reply to message #1794095] |
Mon, 03 September 2018 16:35   |
Eclipse User |
|
|
|
Hi Christoph,
thanks for your inputs again. !
But I have some issues doing this, I don't know what is missing,
- When I set the root node(Top_Node from the attachment) layoutHierarchy to true, it seems the Edges across the nodes appear proper, but I am loosing all the Nodes .
- Top_Node is an instance of org.eclipse.graphiti.mm.pictograms.Diagram for me.
- When I set the root node(Top_Node from the attachment) layoutHierarchy to false, it seems the Nodes appear proper. The edges also appear but not properly layouted.
Below are my layout options, @ ILayoutConfig.getOptionValue(LayoutOptionData, LayoutContext)
if (Properties.NODE_LAYERING.getId().equals(optionData.getId())) {
return LayeringStrategy.INTERACTIVE;
} else if (Properties.CYCLE_BREAKING.getId().equals(optionData.getId())) {
return CycleBreakingStrategy.GREEDY;
} else if (Properties.CROSS_MIN.getId().equals(optionData.getId())) {
return CrossingMinimizationStrategy.LAYER_SWEEP;
} else if (LayoutOptions.SEPARATE_CC.getId().equals(optionData.getId())) {
return Boolean.FALSE;
} else if (LayoutOptions.DIRECTION.getId().equals(optionData.getId())) {
return Direction.RIGHT;
} else if (LayoutOptions.EDGE_ROUTING.getId().equals(optionData.getId())) {
return EdgeRouting.ORTHOGONAL;
} else if (LayoutOptions.SPACING.getId().equals(optionData.getId())) {
return new Float(40);
} else if (Properties.BORDER_SPACING.getId().equals(optionData.getId())) {
return new Float(20);
} else if (LayoutOptions.PORT_CONSTRAINTS.getId().equals(optionData.getId())) {
return PortConstraints.FIXED_POS;
} else if (LayoutOptions.ASPECT_RATIO.getId().equals(optionData.getId())) {
return new Float(13);
} else if (Properties.NODE_PLACER.getId().equals(optionData.getId())) {
return NodePlacementStrategy.LINEAR_SEGMENTS;
}
else if (LayoutOptions.LAYOUT_HIERARCHY.getId().equals(optionData.getId())) {
// logic to find the root node.
if (Top_Node) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}
Any inputs would be great.
Thanks again !
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03006 seconds