HOw to make nodes starting xy pont from left corner of the node (rectangle)

var diagram =$$(go.Diagram, “myDiagramDiv”,
Dear Friends,

I want to make nodes in left sides to be fixed while scrolling horizontally. iam using below code and making all the nods to be fixed while horizontal scroll :

{
“InitialLayoutCompleted”: function(e) {

},
layout:
$$(go.TreeLayout,
  {angle:90, layerSpacing:100}),
"ViewportBoundsChanged": recenterRoot,

});

function recenterRoot(e) {
//--------------------------recenter------------------------------------------------------------------
if(mainCtrlInc>=maxCtrl){
for(var inc3=1; inc3<=mainCtrlInc; inc3++){
var root = e.diagram.findNodeForKey(“C_”+inc3);
if (root) {
e.diagram.commit(function (diag) {
root.location = new go.Point(diagram.viewportBounds.left, root.location.y);
}, null); // don’t record in UndoManager
root.layerName = “Foreground”;
}
}
}
}

in this all the left nodes (rectangles) shows horizontally half, starting half go and hide inside. I think the xy (registration point)starts for these nodes from center. HOw can I make that nodes xy starts from center or top of Left side of the nodes?

Thanks and Regards,
Syed Abdul Rahim

Don’t set Part.locationSpot.

Also, don’t execute transactions within a loop. Instead, do the whole loop within a single transaction.

I removed locationSpot from nodeStyle, its working and I can see that node fully . as already I told u, iam using tree model to create a chart and creating extra node(that is what hiding now shows fully) and placing on left corner on each row. But now my tree diagram also starts in same left corner. so first node is overlapping on that extra node. how can I give some space and start the drawing like left margin .

I mean in below pic:
https://forum.nwoods.com/uploads/db3963/original/2X/0/074ec7b6f09ade1280234d6d2488f4be455f8d38.jpeg

green color node (out_2_1 & out_1_1) is overlapping with blue color nodes (C_2 & C_1).

Position your extra nodes farther to the left. You may want to scroll the diagram to make sure your extra nodes are fully within the viewport.