Layered & Layered-Horizontal Graph layout

Hi,
I am using GoJs (V1.4.6) graphs to create layered and layered-horizontal layouts. I have ensured that my layout settings are identical to what has been shown here : https://gojs.net/latest/samples/ldLayout.html.
Below is my code for “Layered” layout.

   layout = make(go.LayeredDigraphLayout, {
                        direction: 0,
                        aggressiveOption: go.LayeredDigraphLayout.AggressiveLess,
                        cycleRemoveOption: go.LayeredDigraphLayout.CycleDepthFirst,
                        initializeOption: go.LayeredDigraphLayout.InitDepthFirstIn,
                        iterations: 4,
                        layeringOption: go.LayeredDigraphLayout.LayerLongestPathSource,
                        packOption: go.LayeredDigraphLayout.PackStraighten,
                        columnSpacing: 10,
                        layerSpacing: 35,
                        setsPortSpots: true
                    }); 

and I end up with the graph layout

I was expecting the node (with house like icon) to appear on the right-hand side of the transaction-like node( $ icon). What am I missing?. The first 3 levels appear OK but not there after.

Note : I have similar problem with “layered-horizontal” layout as well.

.

Any help is highly appreciated.

Cheers,
Archie

It looks like you have two links for the house node, going both ways. This is probably thinking that the house node is a parent of the ($) node, and not a child.

Either delete one of the links so that the house node is truly a child of the ($), or for the link that goes

House -> ($)

set the property isTreeLink: false

Hi Simon,
Thanks for your reply. However, it does not seem to resolve the issue.
If you observe either screenshot from my earlier post, you will notice that the arrows to $ nodes are coming from its parent node (3 rectangular bars icon). So, there is only one arrow pointing to house node coming from $ node making the house node child of $ node and have ensured that it’s not bidirectional (i.e. there is no 2 way relationship between the house and $ nodes).

Thanks!