Skip to content

@graphty/graphty-element / extend / EdgeView

Interface: EdgeView ​

Defined in: graphty-element/src/simple/types.ts:191

One edge of the graph an algorithm or a layout reads.

Properties ​

id ​

readonly id: string

Defined in: graphty-element/src/simple/types.ts:193

The element's edge id: the same id a selection, a style and an export use.


source ​

readonly source: NodeView

Defined in: graphty-element/src/simple/types.ts:198

The endpoints as the data stored them. In a directed view source is where the edge starts. In an undirected view the two are just the two ends: use other(node).


target ​

readonly target: NodeView

Defined in: graphty-element/src/simple/types.ts:200

The other end the data stored: where a directed edge ends.

Methods ​

attr() ​

attr(path): unknown

Defined in: graphty-element/src/simple/types.ts:210

An attribute or a published result, by path, as NodeView.attr reads one.

Parameters ​

path ​

string | undefined

Returns ​

unknown


number() ​

number(path): number | undefined

Defined in: graphty-element/src/simple/types.ts:212

attr(path) when it is a finite number; undefined otherwise.

Parameters ​

path ​

string | undefined

Returns ​

number | undefined


other() ​

other(node): NodeView

Defined in: graphty-element/src/simple/types.ts:202

The end that is not node (a self-loop returns node). Throws when node is not an end.

Parameters ​

node ​

NodeView

Returns ​

NodeView


weight() ​

weight(path): number | undefined

Defined in: graphty-element/src/simple/types.ts:208

The edge's weight at path: 1 when path is undefined (an unbound optional weight), the number when there is one, undefined when the value is missing or is not a number. A read that finds no number is counted in the run record's warning, never read as 0.

Parameters ​

path ​

string | undefined

Returns ​

number | undefined