Issue with Node Positioning and Container Wrapping in TreeLayout #2674
-
IntroductionWhen using the TreeLayout with Angular, I'm having trouble locating nodes inside of containers. The nodes and containers are not acting as I would like them to in terms of their locations and the links that connect them. Scenario 1: After creating links, the child nodes get new positions, but they are spread out instead of being stacked. The nodes are outside of their containers because the containers stay in their original placements. Every container is piled on top of the others. But shifting a container also affects its offspring nodes, which is correct. Situation 2: In the event that no links are made, nodes stay inside their containers but all nodes and containers overlap at the starting point. The intended result is for child nodes to be stacked inside of parent containers. I appreciate your help. Library version: 4.0.0 Steps to reproduce
Restrictions & ConstraintsNo response Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Could you please provide a screenshot of the desired result (preferably for a smaller dataset)? |
Beta Was this translation helpful? Give feedback.
Could you manually create a diagram that looks like what you are trying to achieve automatically? I'm not sure what to look for in this picture.
Is your diagram a tree? The
TreeLayout
is mean to be used with the tree graphs only.The DirectedGraph can position and resize the clusters for you if you enable
resizeClusters
option.Here's a combination of
TreeLayout
and containers: https://www.jointjs.com/demos/corporate-organizational-chartHere's a combination of
DirectedGraph
andGridLayout
: https://www.jointjs.com/demos/jointjs-layouts