Default nodes placement is too narrow. How to change it?

I am new to gojs and currently working at the state chart. I noticed that when i set up nodes without loc attributes they are set up in the middle of the diagram with very little spacing between. Is there any way to stretch the nodes by default, setting margin or forcing min link length?

Yes, if you do not provide Node.location (or Node.position) values somehow, usually through data binding, then you are letting the Diagram.layout assign such values.

By default the Diagram.layout is an instance of Layout which provides are very fast but very stupid algorithm to make sure each Node has a real location.

You might want to use GridLayout or some other layout. Read more about them at

Thanks for the reply @walter. I tried alle the layouts presets but i kinda like default layout behaviour the most for my case. The problem is only about spacing on chart init. If i do not find solution with chart settings i probably will have to write some algorythm to generate node positions by default so they are a bit more spread.

I know nothing about the sizes of your nodes, but I really think that GridLayout is what you want to use. Have you seen how to customize it?

Try setting cellSize to new go.Size(1, 1) and spacing to some suitable size and alignment to go.GridLayout.Position.