I am having to do my own custom layout. I need to layout “network” nodes in some specific ways. Here is an example of one (picture below). In this, I am trying to do a “balanced” (right/left) layout. The algorithm I am using is basically:
- Center middle/root node
- Define the right and left sub-boxes.
3 For each side (right/left):
a. Calculate the relative weight widths of each node horizontal slice (a slice is the next node sets to be layed out vertically together).
b. recursively go through each slice and determine the width for the slice box; calculate the vertical sub slices (if more than one object per slice); and then center each slice node in a sub box defined by weighted slicing horizontally and vertically.
What I am seeing is that it seems:
The middle/root node is not being centered correctly. I have checked the math and debugged it and the coordinates that are being set are “centered” based on the view component they are contained in.
The right and left “slices” of nodes seem to be centering above the root, which is even more disturbing.
Is there some silent adjustments that are taking place behind the scenes after I do my manual layout? If so what are they?
Does anyone know why if a view container bounds are used to center the root node, why it would end up low and to the right?
Here is the picture.
<wow it won’t let me add the picture>