如何在vis.js中设置节点的位置?
我想最初手动定位至少一个节点.
我知道节点有x和y选项.我设置了两个,并尝试了各种布局选项(randomSeed,ImprovedLayout,hierarchical),节点从未放置在我设置的位置.
这是我定义的简单网络:
nodes = new vis.DataSet([
{id: 1, shape: 'circularImage', image: DIR + '1_circle', label:"1", x: 200, y: 100},
{id: 2, shape: 'circularImage', image: DIR + '2_circle', label:"2"},
{id: 3, shape: 'circularImage', image: DIR + '3_circle', label:"3"},
]);
edges = [
{id: "01-03", from: 1, to: 3, length: 300, label: '1 - 3'},
{id: "02-03", from: 2, to: 3},
];
var container = document.getElementById('graphcontainer');
var data …Run Code Online (Sandbox Code Playgroud)