Closed glampr closed 9 years ago
Hi,
Unless you manually set the lengths of the edges, no. I don't think this will be possible in the future either.
Regards,
Alex
Hi Alex,
This was my original thought as well, but that does not work very well in all cases since nodes inside a group might not be well connected to each other (a group can even have several connected components).
Will the only other option then be to develop a custom physics solver? I can see that something like that is not supported officially but you think it could be possible?
Hi,
Sure anything is possible :). My guess would be that you'd implement an extra gravity solver, determining the center of the group each iteration and applying a force to the nodes in that group towards that center.
Come to think of it that shouldnt be too difficult. You could make a new option for nodes: physicsGroup for this. You can make two options in the physics to enable the physics groups and set the strength. physics:{groups:{enabled: true/false, strength: number}}
It could even be a fun challenge ;)
Is this something that would work on all the available solvers ('barnesHut', 'repulsion', etc...) as an addition/modification? What would be the "easiest" one to experiment with in your opinion?
The solvers are seperated, all you'd need to look at is the central gravity solver. It will then work with all the other "major" solvers.
Youd need to add the call to the solve method in the physicsEngine
I will look into this. Thanks for the help!
I'd be curious to hear if it works :) keep me posted on your progress.
Good luck!
Check out #1240
I've commented your pull. As Jos mentioned we can only accept pulls to the develop branch.
Cheers
Hi, are you still willing to update your pull or should we close it?
Regards
Feel free to close for now, you've given enough pointer so I will update it once I have more time to work on it! Thanks!
I was wondering if it is possible to have nodes that belong to the same group be drawn visually close to each other, and as separately as possible from other groups.
Kind of like in this example: