Skip to content

computeDetachAnchor

since v1.4.0

computeDetachAnchor(edge, end, node): null | Point

Computes the position where a detached endpoint stays: the current position of the port when the edge was connected to a port, otherwise the routed endpoint of the edge, or the center of the node as a last resort. Call it while the node still exists in the model.

Edge

The edge whose endpoint is being detached.

EdgeEnd

The endpoint to detach.

The node the endpoint is connected to, if it still exists.

undefined | null | Node

null | Point

The anchor position, or null when none can be computed.