How to position node without parent to first level in Layered Digraph?

My graph currently is as follow :

what i want to achieve is :

so for some reasons if a node doesn’t have any parents it will be positioned to deeper level, some of my nodes are positioned at right most because they don’t have any links

please any help will be appreciated, thank you

How have you declared the Diagram.layout? Have you tried setting LayeredDigraphLayout | GoJS API ?

If that doesn’t do it, you could override LayeredDigraphLayout | GoJS API to call the super method and then adjust the layers of all of the vertexes to suit your needs.

so i tried assigning the layer and it worked
but the distance between one node to the other are quite long.

how to pull the target node close to source node ?

Can you show us your code so we can reproduce this? Also, please enter real information in your profile for your company if you’d like continued support.