Closed WYBupup closed 2 months ago
If I am not mistaken, you call ELK as specified here and set the algorithm to dot. You can find the supported dot options here. If you just want to call the algorithm, you can also try calling the GraphvizLayoutProvider directly.
Is there a specific thing that "dot" can do that "layered" cannot?
Thanks nfor your reply. Im now trying to layout my graph using TreeLayoutProvider. I want to span the tree from left to right and write the following code:
LayoutMetaDataService.getInstance().registerLayoutMetaDataProviders(
new LayeredMetaDataProvider(),
new MrTreeMetaDataProvider()
);
layoutProvider = new TreeLayoutProvider();
KNode graph = ....
graph.setProperty(CoreOptions.DIRECTION, Direction.RIGHT);
layoutProvider.layout(graph, new BasicProgressMonitor());
//draw graph
but I still get the tree which span from bottom to up.... (below)
I think the problem may be graph.setProperty(CoreOptions.DIRECTION, Direction.RIGHT);
Can you guide me to fix it?
The direction property was only introduced in ELK 0.9.X (although our documentation does currently not reflect that). Maybe this is the issue?
Are you sure that the top KNode graph is actually the parent of the other nodes? Sometimes there is a node in between.
Oh, the documentation seems to be quite old. You should use the ElkNode that is actually available in ELK. The no longer used by ELK.
The algorithm is working as expected here. The problem is simply that the coordinate system in the figure is the wrong way round. (0, 0) should be in the top-left corner and positive-y goes down instead of up.
I am new to ELK, but even if I finished reading the documentation, I still have no idea how to solve my problem. Specifically, I want to use elk to compute the coordianates for my graph using graphviz dot layout algorithm.. Can anyone help point where the tutorial is?