Skip to content

@eightkk/vue-weave / core / countGraphCrossings

Function: countGraphCrossings() ​

countGraphCrossings(layout, edges, direction?): number

Defined in: src/core/graphCrossings.ts:44

Count crossings between edges that connect adjacent ranks, measured on the node centres of a layout. Long edges, same-rank edges and self-loops use their own routes and are not counted. Throws a RangeError for an unknown direction or a box of an edge end without finite geometry and rank, and an Error for an edge end without a box.

Parameters ​

layout ​

GraphLayout

edges ​

readonly GraphEdge<unknown>[]

direction? ​

GraphLayoutDirection = 'LR'

Returns ​

number

Released under the MIT License.