@graphty/graphty-element / session / RunResult
Interface: RunResult ​
Defined in: graphty-element/src/session/results/types.ts:839
What a run produced.
The statistics are ON this object rather than left to the consumer, because a consumer that reconstructs a ranking or a histogram from per-node values is reimplementing work the element already did while walking the result, and does it with less information: it cannot see which elements were in scope, which were measured, or what the run's caveats were.
Properties ​
fields ​
readonlyfields: readonlyFieldDescriptor[]
Defined in: graphty-element/src/session/results/types.ts:845
Every field this result actually published, with its path and its plain name.
graph ​
readonlygraph:Readonly<Record<string,unknown>>
Defined in: graphty-element/src/session/results/types.ts:854
The graph-level fields, keyed by field name.
measured ​
readonlymeasured:object
Defined in: graphty-element/src/session/results/types.ts:847
How many nodes and edges the run looked at.
edges ​
readonlyedges:number
Edges in the run's scope.
nodes ​
readonlynodes:number
Nodes in the run's scope.
runId ​
readonlyrunId:string
Defined in: graphty-element/src/session/results/types.ts:841
The run that produced this.
shape ​
readonlyshape:"node-metric"|"edge-metric"|"community"|"layered-grouping"|"category-table"|"path"|"node-set"|"edge-set"|"pair-list"|"temporal"|"fact"
Defined in: graphty-element/src/session/results/types.ts:843
The shape, which fixes the field names below.
Methods ​
band() ​
band(
field):FieldBand|undefined
Defined in: graphty-element/src/session/results/types.ts:929
Which band of its interpretation scale a graph-level field's value falls in, such as "clear" for a community result's modularity above 0.3. The bands, their thresholds and their source are on the field's interpretation in the catalogue.
Parameters ​
field ​
string
The graph-level field, such as "modularity".
Returns ​
FieldBand | undefined
The band, or undefined when the field has no interpretation or no finite value.
column() ​
column(
field):NumericColumnView
Defined in: graphty-element/src/session/results/types.ts:872
One numeric field as a column.
Parameters ​
field ​
string
The field name.
Returns ​
A view over the values, without an object per element.
edge() ​
edge(
id):Readonly<Record<string,unknown>> |undefined
Defined in: graphty-element/src/session/results/types.ts:866
One edge's fields.
Parameters ​
id ​
string
The edge id.
Returns ​
Readonly<Record<string, unknown>> | undefined
The fields, or undefined when the run produced nothing for that edge.
groupSizes() ​
groupSizes(
options?):Histogram
Defined in: graphty-element/src/session/results/types.ts:907
The distribution of a grouping result's group sizes: how many groups have each size.
A bar counts GROUPS, not elements, so the counts add up to the number of groups. It is the same Histogram RunResult.histogram returns, so one chart draws both: one bar per size when there are few distinct sizes ("per-value"), bands otherwise ("banded").
Parameters ​
options? ​
How to cut the bins.
Returns ​
The bins, in ascending order of size.
Throws ​
A GraphtyError coded E_BAD_COMMAND when the result publishes no groups (it is not a community or a layered grouping), or E_OPTION_RANGE when the bin count is out of range.
histogram() ​
histogram(
field,options?):Histogram
Defined in: graphty-element/src/session/results/types.ts:895
The distribution of one numeric field.
Parameters ​
field ​
string
The field to bin.
options? ​
How to cut the bins.
Returns ​
The bins, in ascending order.
node() ​
node(
id):Readonly<Record<string,unknown>> |undefined
Defined in: graphty-element/src/session/results/types.ts:860
One node's fields.
Parameters ​
id ​
The node id.
Returns ​
Readonly<Record<string, unknown>> | undefined
The fields, or undefined when the run produced nothing for that node.
ranking() ​
ranking(
field,limit?): readonlyRankingEntry[]
Defined in: graphty-element/src/session/results/types.ts:879
The highest-ranked elements on one field.
Parameters ​
field ​
string
The field to rank on.
limit? ​
number
How many entries to return; the whole ranking when absent.
Returns ​
readonly RankingEntry[]
The entries, best first.
reading() ​
reading(
options?):string
Defined in: graphty-element/src/session/results/types.ts:921
What this result means, in one sentence of plain language.
Generated from the result's own statistics by templates, never by a language model, and never asserting something the run did not compute.
Parameters ​
options? ​
The locale and how technical to be.
Returns ​
string
The sentence.
summary() ​
summary():
ResultSummary
Defined in: graphty-element/src/session/results/types.ts:912
The bounded form of this result.
Returns ​
The summary.
top() ​
top(
field,n):TopRanking
Defined in: graphty-element/src/session/results/types.ts:888
The top n elements on one field, cut only between tie groups. See TopRanking for the tie policy. A { match: "top" } style selector and a { top } selection target both read this, so the two can never disagree about which elements are the top n.
Parameters ​
field ​
string
The field to rank on.
n ​
number
The most elements the top may hold.
Returns ​
The elements taken, and the tie group left out when there was one.