关于下面的代码,我无法弄清楚为什么vis.js
在树之间增加了很多空间。
var options = {
//locale: 'en',
interaction:{hover:true, dragNodes :false},
layout: {
randomSeed: undefined,
hierarchical: {
enabled: true,
parentCentralization: true,
}
},
edges: {
color: {
opacity: 0.4,
}},
};
答案 0 :(得分:0)
它与物理默认有关。 您可以将其更改为false。 您也可以像这样配置treeSpacing ...
physics: false,
/*layout: {
hierarchical: {
enabled: true,
levelSeparation: 190,
nodeSpacing: 250,
treeSpacing: 280,
sortMethod: "hubsize"
}
}*/