无法读取未定义

时间:2015-07-30 17:37:23

标签: javascript d3.js graph

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));`

            }

0 个答案:

没有答案