anvaka / ngraph.offline.layout

Performs offline layout of large graphs and saves results to the disk
MIT License
33 stars 10 forks source link

TypeError: value is out of bounds #1

Closed job closed 9 years ago

job commented 9 years ago

I'm trying to generate a positions.bin file but so far not succeeding:

$ nodejs -v
v0.10.40
$ nodejs
> var graph = require('ngraph.generators').grid(100, 100);
undefined
> var createLayout = require('ngraph.offline.layout');
undefined
> var layout = createLayout(graph);
undefined
> layout.run();
Step 1
Step 2
Step 3
Step 4
Step 5
Saving:  data/5.bin
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:784:11)
    at Buffer.writeInt32LE (buffer.js:916:5)
    at /tmp/node_modules/ngraph.offline.layout/index.js:91:11
    at Object.objectKeysIterator [as forEachNode] (/tmp/node_modules/ngraph.generators/node_modules/ngraph.graph/index.js:496:11)
    at saveIteration (/tmp/node_modules/ngraph.offline.layout/index.js:88:11)
    at Object.run (/tmp/node_modules/ngraph.offline.layout/index.js:52:9)
    at repl:1:8
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
job commented 9 years ago

Updating node solved the issue.

anvaka commented 9 years ago

Glad you found a solution!

I wasn't aware that this library doesn't work node 0.10