@graphty/graphty-element / session / ChannelAgreement
Type Alias: ChannelAgreement ​
ChannelAgreement = {
channel:Channel;layerId:LayerId;state:"agree";unpainted:number;value:unknown; } | {breakdown: readonlyChannelShare[];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 ​
readonlychannel:Channel
The channel.
layerId ​
readonlylayerId:LayerId
The layer that decided it for all of them.
state ​
readonlystate:"agree"
Every painted element carries the same value from the same layer.
unpainted ​
readonlyunpainted:number
How many elements of this channel's kind nothing painted on it.
value ​
readonlyvalue:unknown
The value they all carry.
Type Literal ​
{ breakdown: readonly ChannelShare[]; channel: Channel; state: "mixed"; unpainted: number; }
breakdown ​
readonlybreakdown: readonlyChannelShare[]
Each value and deciding layer, most elements first.
channel ​
readonlychannel:Channel
The channel.
state ​
readonlystate:"mixed"
The painted elements carry more than one value, or one value from more than one layer.
unpainted ​
readonlyunpainted:number
How many elements of this channel's kind nothing painted on it.