Placement guides to see alignment


I cam comparing multiple diagram solutions and I would like to know if gojs has the ability to show placement guides to see if nodes are well aligned with each other when moving them (other library like mxgraph have this ability)? Thank you for your answer.

Those are called “guidelines”. Use the GuidedDraggingTool extension.

Several samples use this, including:

Some documentation is at:

Thank you for your answer.

I also try to make the links straight when they are not connected to any node. I anderstand that `

dragComputation: function (part, pt, gridpt) { return gridpt; }

makes the link snap to grid when moving the entire link. However, I would like the handle of the link also snap to grid when moving only the handle. That would help the user make straight links. I there such a possibility?

For snapping the intermediate points of a link to a grid, use the SnapLinkReshapingTool extension. See it used at and defined at

I don’t think there is an example of snapping the end points of a link to a grid, but I think you could modify the LinkShiftingTool extension, demonstrated at and defined at But I’m not sure that tool works for completely disconnected Links.

A post was split to a new topic: How to keep tree roots at original locations