Skip to main content

blockly > ConnectionDB

ConnectionDB class

Database of connections. Connections are stored in order of their vertical component. This way connections in an area may be looked up quickly using a binary search.

Signature:

export declare class ConnectionDB

Constructors

Constructor

Modifiers

Description

(constructor)(connectionChecker)

Constructs a new instance of the ConnectionDB class

Methods

Method

Modifiers

Description

getNeighbours(connection, maxRadius)

Find all nearby connections to the given connection. Type checking does not apply, since this function is used for bumping.

init(checker)

static

Initialize a set of connection DBs for a workspace.

removeConnection(connection, yPos)

Remove a connection from the database. Must already exist in DB.

reorderConnection(connection, newYPos)

Moves the given connection in the connection DB to reflect its new Y position. For performance, this will be deferred if the connection DB is in the middle of a bulk update.

searchForClosest(conn, maxRadius, dxy)

Find the closest compatible connection to this connection.