Different layouts in one diagram

Nature of the graph will be like below.


The diagram will have all these combinations in a single diagram.
For Example: Bus topology connected to Star connected to Tree connected to Mesh and so on…
Each node in a single topology can have another completely different topology.
Please help me with this.

If you put each subgraph in a separate Group you could have separate Group.layouts.

You would probably bind:

myDiagram.groupTemplate =
  $(go.Group,
      . . .,
      new go.Binding("layout", "topo", layoutForTopo),
      $(go.Placeholder)
  );

function layoutForTopo(topo) {
  switch (topo) {
    case "star": return new go.ForceDirectedLayout(...);
    case "ring": return new go.CircularLayout(...);
    case "line": return new SerpentineLayout(...);
    . . .
}

Hmmm, there isn’t a bus Layout that we provide, although you could adapt TimelineLayout from Timeline

I may not get the type of topology from API response data.
I will just get the data with their connections

Would the user choose the layout? That’s just a matter of setting that data.topo property.