Skip to content

@graphty/graphty-element / extend / WholeGraphScoreDefinition

Interface: WholeGraphScoreDefinition<O> ​

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

A score per node computed over the whole graph at once (an iteration, a propagation).

Extends ​

  • AlgorithmDefinitionBase<O>

Type Parameters ​

O ​

O extends OptionsShorthand

Properties ​

description? ​

readonly optional description?: string

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

One sentence for pickers and the catalogue. Default: "".

Inherited from ​

AlgorithmDefinitionBase.description


direction? ​

readonly optional direction?: "directed" | "undirected"

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

"undirected" (the default) ignores edge direction, and the directed accessors of the view throw.

Inherited from ​

AlgorithmDefinitionBase.direction


edge? ​

readonly optional edge?: undefined

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


groups? ​

readonly optional groups?: undefined

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


id ​

readonly id: string

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

Permanent id: lower case, hyphenated, vendor-prefixed ("acme-hop-reach"). Kept unchanged when the extension graduates.

Inherited from ​

AlgorithmDefinitionBase.id


name? ​

readonly optional name?: string

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

What pickers show. Default: the id in sentence case ("acme-hop-reach" reads "Acme hop reach").

Inherited from ​

AlgorithmDefinitionBase.name


node? ​

readonly optional node?: undefined

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


nodes ​

readonly nodes: (graph, context) => ReadonlyMap<NodeId, Score> | Promise<ReadonlyMap<NodeId, Score>>

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

Every node's score at once, as a Map keyed by node.id; may be async.

Parameters ​

graph ​

GraphView

context ​

AlgorithmContext<OptionValuesOf<O>>

Returns ​

ReadonlyMap<NodeId, Score> | Promise<ReadonlyMap<NodeId, Score>>


options? ​

readonly optional options?: O

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

The options a reader may set, in short form: { spacing: 2, weight: { type: "attribute", on: "edge" } }.

Inherited from ​

AlgorithmDefinitionBase.options


passes? ​

readonly optional passes?: keyof O & string

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

For a whole-graph function that walks the graph repeatedly: the integer option that caps the passes.

Inherited from ​

AlgorithmDefinitionBase.passes


suggestedName? ​

readonly optional suggestedName?: (options) => SuggestedName | undefined

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

Optional: the name of a run's result, from its option values. id becomes the path a style layer reads (results.<id>.value): lower-case letters, digits and underscores. label is what the layer list and legend show. Return undefined to use the algorithm id.

Parameters ​

options ​

OptionValuesOf<O>

Returns ​

SuggestedName | undefined

Inherited from ​

AlgorithmDefinitionBase.suggestedName


version? ​

readonly optional version?: string

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

The extension's own semver version, recorded as provenance.

Inherited from ​

AlgorithmDefinitionBase.version


weights? ​

readonly optional weights?: object

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

Optional: the edge "attribute" option that holds weights, and what they mean. Only what the run record says a weight meant; the weight it records is the one the run actually read.

meaning ​

readonly meaning: "strength" | "distance"

option ​

readonly option: keyof O & string

Inherited from ​

AlgorithmDefinitionBase.weights