Layout parce locations

Hi Walter. I use next nodeDataModel

key: number,
text: string,
diagramSettings: {
  loc: string,

and binding location by next method

new go.Binding('location', 'diagramSettings', (object) => go.Point.parse(object.loc)).makeTwoWay((value, object) => {
      const newSettings = object.diagramSettings;
      newSettings.loc = go.Point.stringify(value);
      object.diagramSettings = newSettings;
      return newSettings;

There are cases when loc is empty string, and when I add two or more objects on diagram they set in the same locations (upon one another).

How to resolve it? I think that my problem in layout. How to set up it?
I use default layout.

You might be interested in this sample that has a function that creates TwoWay Bindings on a sub-property of a particular data property:
Binding data sub-properties

Yes, if you don’t set Diagram.layout the default layout isn’t very smart. It is designed for the policy that the data (or your code) is responsible for assigning a location for each node. But it does assign a real location to each Part that doesn’t have a real Part.location. I suspect that if you have some nodes with “bad” location information or if the binding conversion function has an exception, the nodes end up at the same location.