This sample is a simplified version of the Draggable Link sample. Links are not draggable, there are no custom Adornments, nodes are not rotatable, and links do not have text labels.

Its purpose is to demonstrate the SnapLinkReshapingTool, an extension of LinkReshapingTool that snaps each dragged reshape handle of selected Links to the nearest grid point.

Note how the "LinkReshaped" DiagramEvent listener changes the Link.routing of the reshaped Link, so that it is no longer AvoidsNodes routing but simple Orthogonal routing. This combined with Link.adjusting being End permits the middle points of the link route to be retained even after the user moves or resizes nodes. Furthermore there is a TwoWay Binding on Link.routing, so that the model remembers whether the link route had ever been reshaped manually.

加入 GoJS 交流群
GoJS 交流群 (769862113)