Skip to main content

Home > @jsplumbtoolkit/browser-ui > ViewNodeOrPortOptions > anchorPositionFinder

ViewNodeOrPortOptions.anchorPositionFinder property

Optional function to call on connection drop, to determine the location for the target anchor for the new connection. Returning null from this indicates no preference, and the Toolkit will use its own computed value. Note that the return value from this method is ArrayAnchorSpec, meaning an array in the format [ x, y, orientationX, orientationY, offsetX, offsetY ]. Note also that offsetX and offsetY are optional, and will be defaulted to 0.


anchorPositionFinder?: (el: Element, pos: PointXY, vertex: Node | Group, def: ViewNodeOptions, evt: Event) => ArrayAnchorSpec | null;