@graphty/graphty-element / index / SuggestionOutcome
Type Alias: SuggestionOutcome ​
SuggestionOutcome = {
layerIds: readonlyLayerId[];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 ​
readonlylayerIds: readonlyLayerId[]
The layers it added: one for an encoding, one per half for a highlight.
outcome ​
readonlyoutcome:"added"
The suggestion was added to the style stack.
placedBeneathLayerId? ​
readonlyoptionalplacedBeneathLayerId?: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 ​
readonlysuggestion:StyleSuggestion
Type Literal ​
{ byLayerId: LayerId; outcome: "suppressed"; suggestion: StyleSuggestion; }
byLayerId ​
readonlybyLayerId:LayerId
That layer.
outcome ​
readonlyoutcome:"suppressed"
Not added: a hand-written layer already drives this channel on every element.
suggestion ​
readonlysuggestion:StyleSuggestion
Type Literal ​
{ byRunId: RunId; outcome: "superseded"; suggestion: StyleSuggestion; }
byRunId ​
readonlybyRunId:RunId
The batch member whose suggestion for this channel was used instead.
outcome ​
readonlyoutcome:"superseded"
Not added: a later member of the same batch suggested the same channel.
suggestion ​
readonlysuggestion:StyleSuggestion
Type Literal ​
{ code: GraphtyErrorCode; outcome: "refused"; suggestion: StyleSuggestion; }
code ​
readonlycode:GraphtyErrorCode
The code of that error.
outcome ​
readonlyoutcome:"refused"
Not added: the style stack refused it. The same error went to style:problem.
suggestion ​
readonlysuggestion:StyleSuggestion