http://jsfiddle.net/eM6jU/200/
未捕获的邻居:无法读取未定义的属性‘TypeError’。
它是从下面的循环发出的,你知道为什么会发生这种情况吗?cola.js线路3332
**Watch Expressions**
"i ": Object
length: 144
source: "ds"
target: "sdf"
while (i--) { var e = this.es[i];
var u = getSourceIndex(e), v = getTargetIndex(e);
var d = getLength(e);
this.neighbours[u].neighbours.push(new Neighbour(v, d));
this.neighbours[v].neighbours.push(new Neighbour(u, d));`
}发布于 2021-09-13 13:37:08
在OP提交的this issue中可以找到解决方案。
基本上,cola.js要求链接采用某种格式,即源属性和目标属性需要作为节点数组的索引(而不是节点的名称)。以下是一些格式正确的数据的示例:
{
"nodes": ["Node A", "Node B", "Node C"],
"links": {
{"source": 0, "target": 1},
{"source": 1, "target": 2},
{"source": 2, "target": 0}
}
}https://stackoverflow.com/questions/31730502
复制相似问题