我有一个分层的节点网络,目前看起来像这样:
我希望它看起来更像这样,因为它们居中:
我的网络选项配置当前为:
const graphOptions = {
autoResize: true,
height: '100%',
width: '100%',
locale: 'en',
clickToUse: false,
configure: {
enabled: true,
showButton: true
},
interaction: {
selectConnectedEdges: false
},
nodes: {
margin: { top: 20, right: 20, bottom: 20, left: 20},
color: '#68b9feb3',
borderWidth: 2,
widthConstraint: { maximum: 320 },
font: {
face: "verdana",
size: 30
},
shape: 'box',
shapeProperties: {
"borderDashes": false,
"borderRadius": 16
},
shadow: {
"enabled": true
}
},
physics: {
enabled: false,
},
layout: {
improvedLayout:true,
hierarchical: {
enabled: true,
nodeSpacing: 400,
blockShifting: false,
edgeMinimization: false,
levelSeparation: 200,
parentCentralization: true,
sortMethod: 'directed',
direction: 'UD', // UD, DU, LR, RL
}
},
manipulation : {
enabled : true,
initiallyActive : true,
addNode : false
}
}
关于如何做到这一点的任何想法?