tomnelson / jungrapht-visualization

visualization and sample code from Java Universal Network Graph ported to use JGraphT models and algorithms
Other
47 stars 7 forks source link

ForceAtlas2 like in Gephi #7

Closed SemyonSinchenko closed 4 years ago

SemyonSinchenko commented 4 years ago

Hi! I've implemented a ForceAtlas2 algorithm. I really think that it is one of the most popular and modern force-directed layout algorithm. I tried to save all features from the original paper but also I tried to follow the style of this great library.

Original paper: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679

SemyonSinchenko commented 4 years ago

Yes I was testing it. Not exactly this code but my own local version in my project. I wrote it for myself (because the FR-algorithm was giving me really bad results: all nodes was in one big heap) but I think it may be useful here too. Of course you can move it in any other PR! I see it's all right here!

tomnelson commented 4 years ago

This is a beautiful algorithm. Thanks so much for all the work. I made a couple of changes to fit with the layout algorithm builders and I integrated this algorithm into some demos. It looks great, especially on really large graphs.

SemyonSinchenko commented 4 years ago

I'm sorry! I didn't understand You right. I've finished fixes but I see that You already merged it. One more thing: it seems that there are two another errors.

It seems that I forgot divide xDelta and yDelta by dist. They aren't really Cos and Sin now but they must be! Really soory about it!

tomnelson commented 4 years ago

I saw that your branch was gone from your fork and that you had merged into your master, so I thought it would be too much trouble for you to make the changes. Do you want to submit another PR with the corrections to divide by dist? (I can just make the changes if you prefer). Thanks again for contributing this and for all your work.

SemyonSinchenko commented 4 years ago

I'll make one another PR. Give a 30 minutes :)