adrianco / spigo

Simulate Protocol Interactions in Go
Apache License 2.0
1.12k stars 111 forks source link

Cannot read property 'neighbours' of undefined #50

Open jonbonraki opened 9 years ago

jonbonraki commented 9 years ago

Uncaught TypeError: Cannot read property 'neighbours' of undefined.

it is emanating from the following loop, any idea why is this happening? cola.js line 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));
            }
adrianco commented 9 years ago

I didn't think we were using cola.js yet, what's the context for the error?

jonbonraki commented 9 years ago

issue was resolved refer this https://github.com/tgdwyer/WebCola/issues/128

adrianco commented 9 years ago

I hope you figure out some interesting additions to spigo with cola, could you let us know what you are trying and any results? Thanks!

nellang commented 5 years ago

I get the same error, I also read this ticket: tgdwyer/WebCola#128 but I don't know why in my code, some nodes take the linking (link 1 from image) but some not (link 0 from image). Those nodes are already in my nodes array.

image