-
iamjagjeetOctober 5, 2017 at 1:45 am #8062
Hi Team,
Is there any way to control spacing(vertical & horizontal) between the nodes of weighted tree.
Thanks
JagjeetvizulyOctober 5, 2017 at 9:06 am #8063Hello,
Yes, there are two properties you can use to adjust the horizontal and vertical spacing.
tree.branchPadding(x) will let you set the vertical spacing between elements as a percentage of total height of tree where x = the percentage amount as float. i.e. tree.branchPadding(0.05) will try and space nodes vertically by 5% of total tree height. If you set x = -1 it will try and automatically space nodes vertically for you.
tree.fixedSpan(x) allows you to set a fixed pixel distance between nodes horizontal spacing. i.e. tree.fixedSpan(100) would lay the tree out with a 100 pixel distance between nodes horizontally. If you set x = -1 it will try to automatically set the horizontal node spacing based on the width of the tree.
Cheers,
Tom
vizulyOctober 5, 2017 at 9:06 am #8064Hello,
Yes, there are two properties you can use to adjust the horizontal and vertical spacing.
tree.branchPadding(x) will let you set the vertical spacing between elements as a percentage of total height of tree where x = the percentage amount as float. i.e. tree.branchPadding(0.05) will try and space nodes vertically by 5% of total tree height. If you set x = -1 it will try and automatically space nodes vertically for you.
tree.fixedSpan(x) allows you to set a fixed pixel distance between nodes horizontal spacing. i.e. tree.fixedSpan(100) would lay the tree out with a 100 pixel distance between nodes horizontally. If you set x = -1 it will try to automatically set the horizontal node spacing based on the width of the tree.
Cheers,
Tom
-
|
You must be logged in to reply to this topic.