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) {

  {angle:90, layerSpacing:100}),
"ViewportBoundsChanged": recenterRoot,


function recenterRoot(e) {
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:

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.