Reputation: 291
I'm using JIT's (JavaScript InfoVis Toolkit) Spacetree. Example: http://thejit.org/static/v20/Jit/Examples/Spacetree/example1.html
It's trivial to change the orientation of the whole entire tree to top, right, bottom or left:
st.switchPosition('left', 'animate', fnComplete);
.. but I'd like to do this over specific subtrees of the main tree. So far I have been unable to figure this out. Basically I'm using the Spacetree to display a site map and I'd like to have the whole site visible by default without being cut off. I've set the options so that the whole tree is visible (constrained: false, levelsToShow: 3), but the tree itself is too large for the window. I realize that it might be impossible to avoid this completely but changing the orientation on specific subtrees (probably based on the depth?) would optimize the space that the tree occupies and put more or all of its contents in visible view.
In case it isn't obvious enough by the description, the size of the tree's canvas is the window's size.
Thanks in advance! I look forward to hearing any replies.
Upvotes: 1
Views: 1700
Reputation: 291
The solution is to use a multitree in conjunction with the $orn (orientation) data property at the node level. There is a "hidden" example on the main JIT site (there is no link to it - not even on the demo page).
Spacetree Multitree Example: http://thejit.org/static/v20/Jit/Examples/Spacetree/example4.html
Code: http://thejit.org/static/v20/Jit/Examples/Spacetree/example4.code.html
Very useful.
Upvotes: 1