pro*_*ies 18 infovis space-tree
这是截图
我一直在处理这个问题,试图修改Y的位置,没有任何运气.请注意,Meli Job B似乎未对齐.仅当父框附加到多个父项时才会发生这种情况.我尝试下面的代码来了解一个盒子是否有多个父母,但是我无法确定如何定位Y轴,因为它们都落在同一个地方.
码:
var pos = node.getPos();
var parents = node.getParents();
if(parents.length > 1) {
var subnodes = node.getSubnodes();
for(var i=0; i<subnodes.length; i++) {
var yPos = subnodes[i].getPos();
yPos.y = pos.y;
}
}
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.
var pos = node.getPos();
var parents = node.getParents();
var subnodes = node.getSubnodes();
for(var i=0; i<subnodes.length; i++)
{
var yPos = subnodes[i].getPos();
if(parents.length > 1)
yPos.y = pos.y;
else
yPos.y = 0
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
940 次 |
最近记录: |