@graphty/graphty-element / extend / EdgeScoreDefinition
Interface: EdgeScoreDefinition<O> ​
Defined in: graphty-element/src/simple/types.ts:270
A score per edge, computed one edge at a time. Published as an edge-metric result, field "value".
Extends ​
AlgorithmDefinitionBase<O>
Type Parameters ​
O ​
O extends OptionsShorthand
Properties ​
description? ​
readonlyoptionaldescription?:string
Defined in: graphty-element/src/simple/types.ts:87
One sentence for pickers and the catalogue. Default: "".
Inherited from ​
AlgorithmDefinitionBase.description
direction? ​
readonlyoptionaldirection?:"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 ​
readonlyedge: (edge,context) =>Score
Defined in: graphty-element/src/simple/types.ts:272
The score of one edge; called once per edge. Return the number itself, not a promise.
Parameters ​
edge ​
context ​
AlgorithmContext<OptionValuesOf<O>>
Returns ​
groups? ​
readonlyoptionalgroups?:undefined
Defined in: graphty-element/src/simple/types.ts:275
id ​
readonlyid: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? ​
readonlyoptionalname?: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? ​
readonlyoptionalnode?:undefined
Defined in: graphty-element/src/simple/types.ts:273
nodes? ​
readonlyoptionalnodes?:undefined
Defined in: graphty-element/src/simple/types.ts:274
options? ​
readonlyoptionaloptions?: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? ​
readonlyoptionalpasses?: keyofO&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? ​
readonlyoptionalsuggestedName?: (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 ​
Returns ​
SuggestedName | undefined
Inherited from ​
AlgorithmDefinitionBase.suggestedName
version? ​
readonlyoptionalversion?:string
Defined in: graphty-element/src/simple/types.ts:91
The extension's own semver version, recorded as provenance.
Inherited from ​
AlgorithmDefinitionBase.version
weights? ​
readonlyoptionalweights?: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 ​
readonlymeaning:"strength"|"distance"
option ​
readonlyoption: keyofO&string
Inherited from ​
AlgorithmDefinitionBase.weights