Skip to main content

namespace Link

A potentially valued connection between two nodes, being a 2-valued or 3-valued tuple of which the first two elements are nodes

Companion type: Link<N>

Functions​

fromArgs​

Returns a graph Link from the given node1 and node2 nodes.

Definition​

function fromArgs<N>(node1: N, node2: N): Link<N>;

Type parameters​
NameDescription
N

Parameters​

NameTypeDescription
node1Nthe first connection node
node2Nthe second connection node

fromTuple​

Returns a graph Link from the given 2-tuple tuple.

Definition​

function fromTuple<N>(tuple: [N, N]): Link<N>;

Type parameters​
NameDescription
N

Parameters​

NameTypeDescription
tuple[N, N]the tuple to convert

toTuple​

Returns the given potentially valued link link as a 2-tuple

Definition​

function toTuple<N>(link: Link<N>): [N, N];

Type parameters​
NameDescription
N

Parameters​

NameTypeDescription
linkLink<N>the link to convert