Skip to content

@graphty/graphty-element / session / ChannelAgreement

Type Alias: ChannelAgreement ​

ChannelAgreement = { channel: Channel; layerId: LayerId; state: "agree"; unpainted: number; value: unknown; } | { breakdown: readonly ChannelShare[]; channel: Channel; state: "mixed"; unpainted: number; }

Defined in: graphty-element/src/session/styles/explain.ts:112

One channel across several elements: whether every element painted on it agrees, and on what.

Two elements agree only when they carry the same value AND the same layer decided it, so a layer that writes the value the layer beneath already wrote is a second answer, not the same one. Elements nothing painted on the channel are left out of the comparison and counted in unpainted.

Union Members ​

Type Literal ​

{ channel: Channel; layerId: LayerId; state: "agree"; unpainted: number; value: unknown; }

channel ​

readonly channel: Channel

The channel.

layerId ​

readonly layerId: LayerId

The layer that decided it for all of them.

state ​

readonly state: "agree"

Every painted element carries the same value from the same layer.

unpainted ​

readonly unpainted: number

How many elements of this channel's kind nothing painted on it.

value ​

readonly value: unknown

The value they all carry.


Type Literal ​

{ breakdown: readonly ChannelShare[]; channel: Channel; state: "mixed"; unpainted: number; }

breakdown ​

readonly breakdown: readonly ChannelShare[]

Each value and deciding layer, most elements first.

channel ​

readonly channel: Channel

The channel.

state ​

readonly state: "mixed"

The painted elements carry more than one value, or one value from more than one layer.

unpainted ​

readonly unpainted: number

How many elements of this channel's kind nothing painted on it.