Arrange nodes in pretty view

Hi There!

I have this graph:

and I want to arrange the nodes more “clearly”, not according specific rule or something, But I want to see the nodes and edges nicely.

How can I do that?

Here my diagram:

const dia =
      $(go.Diagram,
        {
          "animationManager.isInitial": true,
          "undoManager.isEnabled": true,
          "initialContentAlignment": go.Spot.Center,
          model: $(go.GraphLinksModel,
            {
              linkToPortIdProperty: 'toPort',
              linkFromPortIdProperty: 'fromPort',
              linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel
            }
          ),
        });

 dia.nodeTemplate =
      $(go.Node, "Auto",  // the Shape will go around the TextBlock
        $(go.Shape, "RoundedRectangle", { strokeWidth: 0, fill: "white" },
          // Shape.fill is bound to Node.data.color
          new go.Binding("fill", "color")),
        $(go.TextBlock,
          { margin: 8, font: "bold 14px sans-serif", stroke: '#333' }, // Specify a margin to add some room around the text
          // TextBlock.text is bound to Node.data.key
          new go.Binding("text", "key"))
      );

Thanks All!

Have you read https://gojs.net/learn ?
You need to set the Diagram.layout property.
More discussion is at: https://gojs.net/latest/intro/layouts.html

Thanks I found this example:

Thank you very much!

BR,

Amit