samizdatco / arbor

a graph visualization library using web workers and jQuery
http://arborjs.org
2.66k stars 635 forks source link

Changes to honor fixed and initial x and y postions. #8

Closed srobertson closed 13 years ago

srobertson commented 13 years ago

The particle system isn't pushing enough information to the background worker. More could be done.

JeffAMcGee commented 13 years ago

I'm dealing with this same bug at the moment. I actually wrote a similar patch, and was about to fork arbor and post it, but then I saw this.

There is a small problem with the patch you supplied: If you create a point with the position (0,0), it goes to a random location, instead of the origin. Something like this will work: c.p.x===null ? c.p.x: _bounds.topleft.x + w*Math.random(),

srobertson commented 13 years ago

Good catch Jeff, thanks.

samizdatco commented 13 years ago

Thanks for noticing this (and for the fix). I've updated the code to something similar to what's here but stuck to the behavior listed in the docs for specifying the initial position (i.e., using {x:, y:, fixed:} rather than {p:{x:,y:}, fixed:} in the .addNode args).

gruppler commented 12 years ago

If I specify initial x and y values for nodes when I create them, nothing moves. It looks like the renderer's init function is never called.