Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single node bug in Arbor.JS

When creating a trivial Arbor JS graph with a single node, the node jitters around all over the place and no further nodes can be added.

The problem is also reported here by another user:

https://github.com/samizdatco/arbor/issues/12

Would appreciate your help with a fix / workaround

like image 916
Chris Beach Avatar asked Oct 07 '11 12:10

Chris Beach


2 Answers

It's not really a fix but I count the number of nodes and if less than on I set the friction to 1.0

if (nodeCount == 1) {
   //Stop single nodes bouncing all over the place
   sys.parameters({ friction: '1.0' });
}
like image 147
ActualAl Avatar answered Oct 22 '22 21:10

ActualAl


Using the d3.js library instead of Arbor has solved my problem :-)

like image 2
Chris Beach Avatar answered Oct 22 '22 20:10

Chris Beach