1

I am using org.eclipse.zest.core.viewers.GraphViewer.setLayoutAlgorithm to set the layout algorithm.

My problem is that when the graph is rendered the nodes are drawn very close to each other and sometime on top of each other.

is there a way to get around this vs writing your own layout algorithm?

enter image description here

Community
  • 1
  • 1
mkk700
  • 83
  • 3
  • 8

1 Answers1

1

This is an old question, but of course you can write new Layout Algorithms for the zest.layout component. As you can see most of them extends from AbstractLayoutAlgorithm. Also you can change the existing layouts, since it is open source. I dont know which one you were using, but the size of the rows and columns for the most layouts is determined/calculated in the preLayoutAlgorithm Function. So here you can change everything as you like. You may have to test step by step the changes in the visualization.

MarryS
  • 165
  • 2
  • 10
  • thank you for that MarryS. I will look into the preLayoutAlgorithm routines. by any chance can you provide a link of that previously asked question that you mention. I did research this quite a bit but didn't come up with much. – mkk700 Apr 16 '15 at 21:54
  • I played around with org.eclipse.zest.layouts.dataStructures.InternalNode which is a parm to preLayoutAlgorithms routines & it's not clear how to adjust the node's position without keeping tack of all previous nodes. is there a more straight forward say to adjust the x,y position of the nodes so that they are not drawn too close to each other. I forgot to mention, i am using a TreeLayout in the image i provided. I plan on doing this for all of the default layout algorithms provided by zest as they all give me the same problem. I need to slace these nodes. – mkk700 Apr 18 '15 at 04:14