Temporary fixed link

Dear support,
I use in my linkTemplate “AvoidNodes”. It works well !

My use case is to disable temporay “AvoidNodes” because I want to drag some node onto a link to set some data in the “condition”-Panel. So currently the link move away from the dragging node.
Is there any oppurtunity to fix the link during the dragging moment ?
Thanks in advance!
image

Are you saying that when you finish moving a node, and the new bounds of the node happen to overlap one or more links with AvoidsNodes routing, that you do not want those links to recompute their routes? That will cause those links to cross over that node.

If that is the case, then do you want that moved node to continue to be avoided when links might be routed? Or do you want it to continue to be avoided, and only the links have their routing changed to AvoidsNodes? Basically, I do not understand what you want for the long-term behaviors of both the dragged node and any crossing links.

Dear support,
your wrote in your reply before:

Yes that’s correct. Only during the dragging movement over the link the routing should be disabled to “catch the link” !
I forgot to tell you, that my use case is only dragging a node onto a link without dropping over the link.
If the dragging is recognized by the ‘condition’ I dragg the node backwards outside the link. The dropping will occur beside the link. The link routing should continue with “AvoidsNodes”.
Summary: Only during the dragging movement the routing should be “disabled”.
Is there any way to do that?
Thanks in advance!

So, during the drag you are modifying the link, which is causing it to be re-routed. But it is not being routed again after the node(s) have been moved away.

I suppose you could customize the DraggingTool either by overriding its doDeactivate method or by implementing a “SelectionMoved” DiagramEvent listener. During the drag you could record which links you had modified; afterwards you could restore their state. That state could include re-setting the Link.routing property, or it could include restoring the Link.points list if you had saved it before modifying the link.

Thanks for your proposal.
I think I can avoid the link routing-“problem” if I drag the “Component1” onto the “Condition”-Panel (LinkLabel) . The ‘mouseDragEnter’ event works successful onto the LinkLabel. My problem is only how can I get the “Link” of the LinkLabel ? The function findObject(“LINK”) return ‘null’. I need the link to get the source- and target-state (State1 and State2);
Thanks in advance!
image

	myWorkspace.linkTemplate =
  $(go.Link, 
		{ name : "LINK" },
		go.Link.AvoidsNodes,
		{
		  relinkableFrom: true, relinkableTo: true,
		  toShortLength: 2,
		  corner: 5,  
		  curve: go.Link.JumpOver,
		  selectable: true
		},
		
		$(go.Shape,
			{ strokeWidth: 2,  stroke: "#FFFFFF" }
		  ),
		$(go.Shape,
			{ toArrow: "Standard", stroke: "#FFFFFF" }
		 ),
		 
		$(go.Panel, "Vertical", // panel condition main
		{ 	background: "#FFFFFF", 
			name : "CONDITION" ,
			
			mouseDragEnter: (e, conditionPanel ) => {
				
				if( conditionPanel == null )
				{
					console.log("conditionPanel = null");
					return;
				}
                 // successfull
				console.log("conditionPanel name = : " + conditionPanel.name);
				
				
				// !!! ERROR : 'link' == null !!!
				var link = conditionPanel.findObject("LINK");
				if( link == null )
				{
					console.log("link = null");
					return;
				}
				console.log("link name = : " + link);

		         ...
		},
		
			$(go.Panel, "Horizontal", 
			{ background: "#ffffff", },
			
				$(go.TextBlock, "condition",
				  { alignment: go.Spot.Left,
					margin: new go.Margin(5, 5, 5, 5), // top, right, bottom, left
					font: "12px Roboto, sans-serif",
					//background: "lightgreen",
					stroke: "rgba(0, 0, 0, .87)",
				  }
				 ),
			),
					
			$(go.Shape, "LineH",
			  {
				stroke: "rgba(0, 0, 0, .60)", strokeWidth: 1,
				height: 1, stretch: go.GraphObject.Horizontal
			  },
			),
			
			$(go.Panel, "Horizontal", 

				$(go.TextBlock , "mappedComponent",
				{ 	margin: mt8,
					font: "10px Roboto, sans-serif",
					stroke: "rgba(0, 0, 0, .87)",
				}			  
				)
			)
		)
	);

conditionPanel.part will be the Link.

Thanks - it works!