Skip to content

@graphty/graphty-element / session / ResultsApi

Interface: ResultsApi ​

Defined in: graphty-element/src/session/results/types.ts:963

Addressing results.

Nobody types a run id by hand: path() builds the string, and every encoding helper takes a run rather than a path. roots is what an expression editor's autocomplete reads, and it is why an unknown results.* path can be reported with the nearest candidates instead of matching nothing in silence.

Properties ​

roots ​

readonly roots: readonly ResultRoot[]

Defined in: graphty-element/src/session/results/types.ts:1002

Every run that has published a result, as an expression editor reads them.

Methods ​

get() ​

get(run): RunResult | undefined

Defined in: graphty-element/src/session/results/types.ts:993

One run's result.

Parameters ​

run ​

RunRef

The run, its result, or its id.

Returns ​

RunResult | undefined

The result, or undefined when the session holds no such run or it has not finished.


has() ​

has(run, field?): boolean

Defined in: graphty-element/src/session/results/types.ts:1000

Whether a run, or one of its fields, is available to read.

Parameters ​

run ​

RunRef

The run, its result, or its id.

field? ​

string

The field name; asks only about the run itself when absent.

Returns ​

boolean

True when the path would resolve.


path() ​

path(run, field?): string

Defined in: graphty-element/src/session/results/types.ts:970

The published path of a run's field.

Parameters ​

run ​

RunRef

The run, its result, or its id.

field? ​

string

The field name; the shape's primary field when absent.

Returns ​

string

The path.


term() ​

term(run, field?): string

Defined in: graphty-element/src/session/results/types.ts:986

The same field, written so a selector expression can read it.

USE THIS ONE INSIDE AN EXPRESSION, and ResultsApi.path for a selector's path member. The difference is not cosmetic. A run id carries its algorithm's name, and ten of the element's twenty-four catalogue algorithms are hyphenated -- shortest-path, min-cut, bipartite-matching -- while the expression grammar reads a bare hyphen as subtraction. So `${results.path(run)} >= \`3\ `` is not a comparison at all on those runs: it parses as one column minus another, and the layer is refused outright. Degree has no hyphen, which is why writing it by hand appears to work right up until the metric changes.

Parameters ​

run ​

RunRef

The run, its result, or its id.

field? ​

string

The field name; the shape's primary field when absent.

Returns ​

string

The path with every segment quoted that needs it, ready to interpolate.