Only allow moving left and right when a node is inside group

I want to lock the movement of y axis and allow the node to move only in x axis when they are in group, while they are ungrouped they can move in both x and y axis.

You could either set the Node’s dragComputation property that determines the permitted new location, or you could set minLocation and maxLocation in a containingGroupChanged function to have the y value be NaN when the Node has a containingGroup or +/-Infinity when not in a Group.

Part | GoJS API
Part | GoJS API
Part | GoJS API

1 Like

Thanks a lot Walter!