Skip to content

@eightkk/vue-weave / core / createGraphConnectionChecker

Function: createGraphConnectionChecker() ​

createGraphConnectionChecker(nodes, edges, rules): GraphConnectionChecker

Defined in: src/core/graphPortRules.ts:140

Builds the rule index once: validates the graph (as indexGraph does) and the rules, and counts the edge ends at every endpoint. check and targets then answer in constant time per endpoint, so a checker suits validateConnection and hints over thousands of nodes. Rules that name an unknown node or port throw an Error, an invalid type or direction an Error, and a negative, fractional or non-finite maxConnections a RangeError. Inputs are not modified.

Parameters ​

nodes ​

readonly IdentifiedNode[]

edges ​

readonly GraphEdge<unknown>[]

rules ​

GraphPortRules

Returns ​

GraphConnectionChecker

Released under the MIT License.