Skip to main content

Home > blockly > RenderedConnection > closest

RenderedConnection.closest() method

Find the closest compatible connection to this connection. All parameters are in workspace units.

Signature:

closest(maxLimit: number, dxy: Coordinate): {
connection: RenderedConnection | null;
radius: number;
};

Parameters

ParameterTypeDescription
maxLimitnumberThe maximum radius to another connection.
dxyCoordinateOffset between this connection's location in the database and the current location (as a result of dragging).

Returns:

{ connection: RenderedConnection | null; radius: number; }

Contains two properties: 'connection' which is either another connection or null, and 'radius' which is the distance.