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

Parameter Type Description
maxLimit number The maximum radius to another connection.
dxy Coordinate Offset 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.