The problem of reshaping line

I set 6 point to a line and made a route for ‘go. Link.Orthogonal’
Set the ‘adjusting’ property to ‘go. Link.End’ (This is the requirement cannot change because I need to guarantee the position of the middle segment)
For illustration:
Question: How to keep ‘templink’ consistent with the real line when I drag the line

or hide ‘templink’, directly display the position of the real line, just like dragging the node at the ends of the line;
That is, when there are no nodes at both ends of the link, the real link state is reflected when the start or end point is dragged.

The two diamond-shaped handles are Relinking handles, created by the RelinkingTool and used to reconnect an end of a link to another port. Or in this case, because RelinkingTool.isUnconnectedLinkValid is true, to no new port at all.

During its operation the RelinkingTool uses LinkingBaseTool properties that are a temporary Link and two temporary Nodes. So you can set properties on the LinkingBaseTool | GoJS API to make it behave like your regular Links do.

If it is sufficient to just set them once when initializing the diagram, that’s great. But I suspect that you need to do such initialization of the temporaryLink and temporaryFromPort and temporaryToPort on each invocation of the RelinkingTool. You can do that by setting the RelinkingTool.portTargeted functional property, or (if necessary) by overriding the more general methods LinkingBaseTool.copyPortProperties and LinkingBaseTool.setNoTargetPortProperties.

myDiagram.toolManager.relinkingTool.copyLinkProperties = function(links,templink){
 
  templink.part.points = links.part.points;
  templink.part.routing = links.part.routing;
  templink.part.adjusting = links.part.adjusting;
  //return go.RelinkingTool.prototype.copyLinkProperties.call(this,links,links);
}

I tried to override this method to set the properties of the ‘temporaryLink’ when dragging.
It’s working, but when I save the data, reload the link data, the first time I drag, or ‘temporaryLink’ and real link inconsistencies, and he changed the center of the real Link

I suggest that you call the base method first – execute your commented-out code first, but don’t return anything, and the third argument must be templink. The arguments must be the same as originally passed to the method.

FYI, here’s the definition of RelinkingTool.copyLinkProperties:

RelinkingTool.prototype.copyLinkProperties = function(reallink, templink) {
  if (reallink === null || templink === null) return;
  templink.adjusting = reallink.adjusting;
  templink.corner = reallink.corner;
  var curve = reallink.curve;
  if (curve === Link.JumpOver || curve === Link.JumpGap) curve = Link.None;  // don't copy "jumping"
  templink.curve = curve;
  templink.curviness = reallink.curviness;
  templink.routing = reallink.routing;
  templink.smoothness = reallink.smoothness;
  templink.fromSpot = reallink.fromSpot;
  templink.fromEndSegmentLength = reallink.fromEndSegmentLength;
  templink.fromEndSegmentDirection = reallink.fromEndSegmentDirection;
  templink.fromShortLength = reallink.fromShortLength;
  templink.toSpot = reallink.toSpot;
  templink.toEndSegmentLength = reallink.toEndSegmentLength;
  templink.toEndSegmentDirection = reallink.toEndSegmentDirection;
  templink.toShortLength = reallink.toShortLength;
};

Note that Link.adjusting and Link.routing are already copied.

I’m wondering if you want not to copy the Link.fromSpot and Link.toSpot properties but force them to be particular spots, to force the routing to get in a particular direction.

Is it because I adjusted some points when I was saving, when I reload it, its 6 points were handled by me, and when I first dragged, the route was recalculated for me.

I don’t know enough about your app or about your question to answer.

I solved the problem,
Thank you for your help!
Routing takes 6 points, but I mistakenly deposited 4 points, causing routing updates;