Minimum no of segments in a link

Hi , I have been searching the forums and API for a while , is it possible to set minimum number of segments in a link with orthogonal routing , so that I can display the rhombus for creating new segments

when 2 nodes are connected in a straight line , the rhombus is not displayed , hence i am not able to stretch(create new segments) horizontally

what i want is the user to be able to do this to the link (since there is no rhombus , not able to stretch it)

Actually, the segment is there, and the diamond resegmenting handle is there too, but it’s hidden behind the square reshaping handles because the end points of that middle segment are at the same point, and the resegmenting handles are behind the reshaping handles of the LinkReshapingTool’s Adornment.

You’ll see them if you move one of the nodes slightly to the left or to the right.

I suppose you could override LinkReshapingTool.updateAdornments to reorder the handles within the Adornment so that the resegmenting handles come last (i.e. in front). Would that be a satisfactory solution? Or can you think of a better solution?

Could you point me to an example so that i can try and see this solution , thanks for the information

Try this custom LinkReshapingTool:

  function CustomLinkReshapingTool() {
    go.LinkReshapingTool.call(this);
  }
  go.Diagram.inherit(CustomLinkReshapingTool, go.LinkReshapingTool);

  CustomLinkReshapingTool.prototype.updateAdornments = function(link) {
    go.LinkReshapingTool.prototype.updateAdornments.call(this, link);
    if (link.pointsCount === 6 && link.getPoint(2).equals(link.getPoint(3))) {
      var ad = link.findAdornment(this.name);
      if (ad !== null) {
        if (ad.elt(0).segmentFraction == 0.5) {
          var e = ad.elt(0);
          ad.remove(e);
          ad.add(e);
        }
      }
    }
  };

Install the custom tool by:

      $(go.Diagram, "myDiagramDiv",
        { . . .
          "linkReshapingTool": new CustomLinkReshapingTool(),
          . . .
        });