I'd like to make a force layout with two types of nodes : type 1 stay in the center, and type 2 move in the periphery. There are links between type 1 and type 2, so the graph should stay together.
I imagine that i can do that with fixing the gravity positive for type 1 node and negative for type two :
force.gravity(function(d){return (d.type=='pers')?10:-15})
but gravity seems to be a one for all parameter. Is there other way or can i change that to make the gravity parameter node dependent ? Or a completely different way to achieve this ?