Repository navigation
Added forceatlas2 layout - #5311
cvanelteren wants to merge 2 commits into
Conversation
a9d4f44 to
365f1c7
Compare
1e92301 to
21d4b2f
Compare
|
Not entirely sure what goes wrong with the build here. This installs for me locally and runs properly. Perhaps one of the maintainers can shed some light on the build environment to make it congruent. |
|
Thanks for this @cvanelteren! There are merge conflicts in one of the file plus we don't setup git submodules while running the CI. I'm generally -1 on adding code through submodules. It would be super great if we could get this in if someone can port |
|
Hi @MridulS! Thanks for clarifying, it was what I suspected. The dependency I understand. The original implementation seems to be pretty low on activity. There are some full features missing from forceatlas2 (judging from the python code) that I may develop at some future stage. However, in its current stage it is highly usable and functioning. I think it would be a valuable addition to networkx. What do you mean exactly with porting it to python and networkx? The code in its current format has an optional dependency for cython, but will otherwise use either the precompiled code or the cython code in pure mode (python mode). To clarify, the default mode is pure python. Converting is loses this flexibility, but I could aid in this too. |
|
The code also appears to have a GPL license: |
|
Correct @jarrodmillman but that does not prevent noncommercial. |
When I saw cython as a dependency I thought parts of it were written in Cython, but that doesn't seem to be the case. thanks for pointing it out. We can't include GPL code with NetworkX (this would require re-licensing the code base from BSD to GPL, this is at least what I understand IANAL). |
|
Ah gotcha. Also no expert here on the licensing with optional dependencies. Let me know if you need my help on anything code related. |
rossbar
left a comment
There was a problem hiding this comment.
I'm generally +1 about adding this layout function (it seems quite popular) but -1 on vendoring an external project like this. In principle we could add an example to the gallery showing how to use forceatlas2 as an external proejct, but I'd even be -1 about that as it looks like the linked code hasn't been updated in 2 years and the last release was Jan. 2019.
|
@cvanelteren I'm going to close this for now, but thanks for starting up the conversation! I would like to see ForceAtlas2 included, but implemented specifically for NetworkX. The original paper https://doi.org/10.1371/journal.pone.0098679 would be good starting point :) |
|
@MridulS ok deal, I have implemented the forceatlas2 based on the paper in native python with networkx. Will perform a pull request later this week when I cleaned up the code a bit. Initial speed is a lot slower than the cython implementation. How does the development team stand on providing a cython or other lower level implenentation for the utility functions in the build process? People have done something similar in the past e.g. https://pypi.org/project/cynetworkx/ |
Added forceatlas 2 layout
I've added the ForceAtlas2 layout from gephi that was implemented by bhargavchippada with linLog merge from victorbenichoux. The ForceAtlas2 layout forms a fast alternative for spring layout and work particularly well for large graphs. It originates from gephi and is a good addition to the networkx toolkit.
Best wishes,
C