Skip to content

@graphty/graphty-element / index / SuggestionOutcome

Type Alias: SuggestionOutcome ​

SuggestionOutcome = { layerIds: readonly LayerId[]; outcome: "added"; placedBeneathLayerId?: LayerId; suggestion: StyleSuggestion; } | { byLayerId: LayerId; outcome: "suppressed"; suggestion: StyleSuggestion; } | { byRunId: RunId; outcome: "superseded"; suggestion: StyleSuggestion; } | { code: GraphtyErrorCode; outcome: "refused"; suggestion: StyleSuggestion; }

Defined in: graphty-element/src/session/runs/types.ts:668

What became of one style suggestion a run made when it first completed.

Branch on outcome and keep a default branch: more outcomes may be added in a minor release. Ids only, never names, so a consumer looks a layer or run up live (styles.get(id), runs.get(id)) and words the result itself.

Union Members ​

Type Literal ​

{ layerIds: readonly LayerId[]; outcome: "added"; placedBeneathLayerId?: LayerId; suggestion: StyleSuggestion; }

layerIds ​

readonly layerIds: readonly LayerId[]

The layers it added: one for an encoding, one per half for a highlight.

outcome ​

readonly outcome: "added"

The suggestion was added to the style stack.

placedBeneathLayerId? ​

readonly optional placedBeneathLayerId?: LayerId

Set when it was placed directly beneath a hand-written layer that drives one of its channels on some elements, so that layer still shows there.

suggestion ​

readonly suggestion: StyleSuggestion


Type Literal ​

{ byLayerId: LayerId; outcome: "suppressed"; suggestion: StyleSuggestion; }

byLayerId ​

readonly byLayerId: LayerId

That layer.

outcome ​

readonly outcome: "suppressed"

Not added: a hand-written layer already drives this channel on every element.

suggestion ​

readonly suggestion: StyleSuggestion


Type Literal ​

{ byRunId: RunId; outcome: "superseded"; suggestion: StyleSuggestion; }

byRunId ​

readonly byRunId: RunId

The batch member whose suggestion for this channel was used instead.

outcome ​

readonly outcome: "superseded"

Not added: a later member of the same batch suggested the same channel.

suggestion ​

readonly suggestion: StyleSuggestion


Type Literal ​

{ code: GraphtyErrorCode; outcome: "refused"; suggestion: StyleSuggestion; }

code ​

readonly code: GraphtyErrorCode

The code of that error.

outcome ​

readonly outcome: "refused"

Not added: the style stack refused it. The same error went to style:problem.

suggestion ​

readonly suggestion: StyleSuggestion