How to delete link when relinking?

Kind regards,

Ah, this isn’t so easy. It requires a “hack”, making use of an override of seemingly unrelated functionality:

    // pretend briefly that unconnected links are OK
    myDiagram.toolManager.relinkingTool.doMouseUp = function() {
      this.isUnconnectedLinkValid = true;;
      this.isUnconnectedLinkValid = false;

    // but instead of reconnecting an existing link to nothing,
    // delete the link instead!
    myDiagram.toolManager.relinkingTool.reconnectLink = function(origlink, newnode, newport, forwards) {
      if (this.targetPort === null) {
        this.diagram.remove(origlink);  // delete the link
      } else {  // do normal reconnection, origlink, newnode, newport, forwards);

Awesome!!! Thank you walter.