Accepted answer

The point of the force layout is to automatically lay out a graph like this so that you don't have to specify the positions of the nodes yourself. How it does that is largely affected by the connections between the nodes. The graph you have doesn't lend itself very well to being laid out in a wide screen format because of its high connectivity -- that is, many nodes are connected to many other nodes. If you were to stretch the graph, some links would become much longer than others and some nodes would be much closer together than others -- this is exactly what the force layout prevents.

You can of course manually "hack" the layout to achieve what you want -- you could, for example, specify different link distances/strengths for each link so that the ones you want to be larger are weaker. Similarly, you could specify a charge function that assigns a weaker repulsion charge to the nodes you want to be closer together.

However, for all of this you would need a pretty good idea of what you want the graph to look like when finished. It would probably be easier to ditch the force layout altogether and simply specify the positions of the nodes yourself.


You can easily squeeze diagram to fit 16:9 better.

9/16 is .5625. In this fiddle you just look for lines that contain .5625, thats all you need to get your diagram squeezed.

And in this another fiddle you can see your diagram completely smashed, with smaller constant. :) .

Since diagram has a little chaotic look, maybe the good constant for your case would be around 0.4. that way it will fit 16:9 with more certainty.

Related Query

More Query from same tag