Centering Node Process

HI there,

I am a begginer to GoJS and I have a problem to play with the integration of GoJS.
I would like to center all my nodes on the middle one.
There is no properties available to do that.
Have you a solution ?

If users are not required to manually position all of the nodes, then it is the layout that is responsible. What is the value of your Diagram.layout?

The value is go.TreeLayout without specific configuration

Your graph isn’t tree-structured, so it should not be surprising that TreeLayout doesn’t do exactly what you want and that there’s probably no easy way to get what you want.

You could try using LayeredDigraphLayout instead. But that may have other undesirable characteristics.

I’ll see if there is a simple solution.

EDIT: can you share your model with us? I would like to know what the graph structure is, since the overlapping link segments make your screenshot ambiguous. You can simplify the data by removing all of your node attributes/properties besides the “key”.

EDIT 2: Also, have you read this forum topic? Reliability Block Diagram layout

EDIT 3: Do you want your nodes to be arranged in columns, and do you know exactly which column each node should go in?

If not, how would you want to tell the layout algorithm how you wanted to lay out:

new go.GraphLinksModel(
    [
      { key: 1 },
      { key: 2 },
      { key: 3 },
      { key: 4 },
      { key: 5 },
      { key: 6 },
      { key: 7 }
    ],
    [
      { from: 1, to: 2 },
      { from: 1, to: 3 },
      { from: 2, to: 6 },
      { from: 3, to: 4 },
      { from: 3, to: 5 },
      { from: 4, to: 6 },
      { from: 5, to: 7 },
      { from: 6, to: 7 }
    ])

The issue is that such graphs have partial orderings within them that make their column determination ambiguous.