Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » Grouping of Nodes using KLay Layered Layout
Grouping of Nodes using KLay Layered Layout [message #1793847] Fri, 17 August 2018 07:32 Go to next message
Raghu Mising name is currently offline Raghu Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
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 34 times)
Re: Grouping of Nodes using KLay Layered Layout [message #1793919 is a reply to message #1793847] Mon, 20 August 2018 13:27 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 80
Registered: September 2015
Member
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 Go to previous messageGo to next message
Raghu Mising name is currently offline Raghu Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
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 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 80
Registered: September 2015
Member
Raghu Mising name wrote on Wed, 22 August 2018 14:11
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 .


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 Go to previous messageGo to next message
Raghu Mising name is currently offline Raghu Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
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 !

Re: Grouping of Nodes using KLay Layered Layout [message #1794824 is a reply to message #1794606] Fri, 07 September 2018 08:21 Go to previous messageGo to next message
Raghu Mising name is currently offline Raghu Mising nameFriend
Messages: 8
Registered: December 2011
Junior Member
I guess I was missing the layout option "SIZE_CONSTRAINT". I was missing the width and height parameters of my Node shapes.
After adding SIZE_CONSTRAINT, I am able to get hierarchical graph .

Thanks Christoph once again for your help. !
Re: Grouping of Nodes using KLay Layered Layout [message #1794827 is a reply to message #1794824] Fri, 07 September 2018 09:24 Go to previous message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 80
Registered: September 2015
Member
Raghu,

empty size constraints leave the width and height of nodes unchanged, except for hierarchical nodes. Glad to hear you were able to solve it, sorry for not getting back to you sooner. ;)

Cheers,
Chris
Previous Topic:How Customized ELK to fit Sirius application?
Next Topic:ELK algorithm change FixPointAnchor y Position to "-1"
Goto Forum:
  


Current Time: Tue Nov 20 11:47:39 GMT 2018

Powered by FUDForum. Page generated in 0.02777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top