Skip to content

@graphty/graphty-element / extend / ScopedInput

Interface: ScopedInput ​

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:81

What a scoped run computes over (design 10.2). OPEN: may gain members.

Properties ​

edgeCount ​

readonly edgeCount: number

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:93

How many edges the scope holds: the set bits of edges.


edges ​

readonly edges: U32

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:87

The scope's edges over the declared graph only, whatever orientation was asked.


graph ​

readonly graph: GraphSnapshot

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:83

The full graph, declared orientation.


nodeCount ​

readonly nodeCount: number

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:91

How many nodes the scope holds: the set bits of nodes.


nodes ​

readonly nodes: U32

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:85

The scope's nodes; valid in both orientations (undirecting keeps node rows).


weight? ​

readonly optional weight?: WeightMeaning | null

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:103

The weight this input was asked for; undefined when it was not asked (see ScopedInputOptions.weight).


whole ​

readonly whole: boolean

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:89

True when the scope is the whole graph; subgraph() then returns graph (or its undirected view).

Methods ​

column() ​

column(optionName): Column

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:128

The column behind a declared "attribute" or "partition" option, over the rows of graph: node rows or edge rows, whichever the attribute is carried on. An option naming a result path (results.<run>.<field>) reads that run's published values. column.meta.name is the path, which is also its name in subgraph().

Parameters ​

optionName ​

string

The option's name.

Returns ​

Column

The column; a row whose element carries no value is unset.

Throws ​

A GraphtyError with E_UNKNOWN_OPTION for an option not declared as an attribute or partition, or E_OPTION_RANGE when nothing in the graph carries what it names.


edgeId() ​

edgeId(row): string

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:109

The element's id of one edge of graph: what an edge result is published under.

Parameters ​

row ​

number

The edge's row in graph.

Returns ​

string

The id.


subgraph() ​

subgraph(): GraphSnapshot

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:101

The derived compact snapshot in the asked orientation. Lazy, cached, shared. It carries every column ScopedInput.column has handed out so far, under the same name, so ask for the columns first. An edge column merges by the same rule as the weights: a reciprocal pair the undirected view collapses keeps its lower row's value, and a group of parallel edges is combined by the simplify policy (a column that is not numeric keeps the group's first).

Returns ​

GraphSnapshot


subgraphEdgeIds() ​

subgraphEdgeIds(row): readonly string[]

Defined in: graphty-element/src/algorithms/input/ScopedInput.ts:117

The ids of every edge of graph behind one edge of subgraph(): more than one when parallel edges were merged, or a reciprocal pair collapsed into one undirected edge. A value computed for the row belongs to each of them, so publish it under every id.

Parameters ​

row ​

number

The edge's row in subgraph().

Returns ​

readonly string[]

The ids, in graph row order.