dhotson / springy

A force directed graph layout algorithm in JavaScript
http://getspringy.com
MIT License
1.88k stars 240 forks source link

Can I set node position in the graph? #89

Open yancychy opened 7 years ago

WenyinWei commented 5 years ago

Hi dhotson,

I have the same request with Yang Chen, would you mind adding this new arguments?

yancychy commented 5 years ago

The algorithm of springy determines the node position are randomly set. If you want to put them in fixed position, you have to design your algorithm.

WenyinWei commented 5 years ago

Thanks a lot. Would you mind pointing out where the core code is? I am not a js user so this may cost some time.

yancychy commented 5 years ago

You can find it : https://github.com/dhotson/springy/blob/master/springy.js . I think they used the Force-directed algorithm: https://www.jianshu.com/p/d3c64a39535a

WenyinWei commented 5 years ago

105 Hello yancychy, @yancychy I have changed the code and now it should support position specification.