Restrict the panning towards left side

Dear Friends,

iam creating a chart like below image: 1

when scroll left or right sides, i freezed the left blue color nodes. its working fine.

i want to add panning towards right side, top & bottom only not left side. How can i restrict not to panning left side of the stage.

Please note that iam freezing left boxes while panning or scrolling right or left side. iam using below code for freezing:

“ViewportBoundsChanged”: recenterRoot,

function recenterRoot(e) {
 cXX = diagram.viewportBounds.x;
 //cY = diagram.viewportBounds.centerY;
 for (var inc4 = 1; inc4 <=mainCtrlInc ; inc4++) {
 var root = e.diagram.findNodeForKey(“C_”+inc4);
 if (root) {
 e.diagram.commit(function (diag) {
 root.location = new go.Point(cXX, root.location.y);
 root.layerName = “Foreground”;
 }, null); // don’t record in UndoManager

Thanks & Regards,
Syed Abdul Rahim

Thanks for listing. pls tell me how can I restrict one side restrictions…

Are you asking how to keep those blue nodes on the right side of the viewport? If so, just modify your “ViewportBoundsChanged” DiagramEvent listener to locate the nodes on the right side of the Diagram.viewportBounds.

If that is not your question, please provide more information. A screenshot of what you want would be helpful.

Dear Mr.Walter,
Already i have freezed blue nodes while panning left and right. i want to pan (red & green nodes not blue) only left wards. I want to restrict the panning towards right.

Thanks & Regards,
Syed Abdul Rahim

Ah, now I understand. Please read and implement a function.

k. thanks,