Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » Creating a graph with containers of SubGraphs
Creating a graph with containers of SubGraphs [message #1801923] Tue, 29 January 2019 14:39 Go to next message
Ohad Baruch is currently offline Ohad BaruchFriend
Messages: 2
Registered: January 2019
Junior Member
I need to create a graph which contains many SubGraphs, each has it's own node's and edges.
The SubGraphs should be treated as nodes as they have dependencies as well.
It should look similar to the example layout here: https://www.eclipse.org/elk/
However, I couldn't find anywhere in the docs how to implement it.
I'm using elkjs-4.1.0
Re: Creating a graph with containers of SubGraphs [message #1802055 is a reply to message #1801923] Thu, 31 January 2019 11:49 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 98
Registered: September 2015
Member
Ohad,

as you can see in our graph model specification, nodes can themselves contain further nodes. It's basically a matter of building your graphs and putting them into their own nodes again. See here for an extremely simple example JSON structure.

Cheers,
Chris
Re: Creating a graph with containers of SubGraphs [message #1802184 is a reply to message #1802055] Sun, 03 February 2019 08:15 Go to previous messageGo to next message
Ohad Baruch is currently offline Ohad BaruchFriend
Messages: 2
Registered: January 2019
Junior Member
Thanks Christoph! Exactly what I needed.

A follow-up question:
I'm trying to properly visualize the whole graph but since I have subgraphs I need to know how many nodes I have in each layer so that I know what height and width to give each containing subgraph.

Is there a way I can see how many nodes there are in each layer in a subgraph?

[Updated on: Sun, 03 February 2019 08:21]

Report message to a moderator

Re: Creating a graph with containers of SubGraphs [message #1802352 is a reply to message #1802184] Thu, 07 February 2019 09:26 Go to previous message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 98
Registered: September 2015
Member
Ohad,

you shouldn't have to set the size of nodes that contain further nodes beforehand, that's what the layout algorithm will figure out automatically. After the layout, you can extract the computed node size from the result and apply it to whatever you use to visualize your nodes.

Cheers,
Chris

[Updated on: Thu, 07 February 2019 09:26]

Report message to a moderator

Previous Topic:Unclonnable property - ElkReflect
Next Topic:Unexpected bends in Layered Layout
Goto Forum:
  


Current Time: Sun Apr 18 19:12:37 GMT 2021

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

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

Back to the top