@graphty/graphty-element / session / LegendBlock
Interface: LegendBlock ​
Defined in: graphty-element/src/session/styles/legend.ts:139
Everything a reader is told about one channel of one layer.
field, scale, domain and palette are each absent when there is nothing true to put in them: a layer that writes a fixed colour reads no field, passes through no scale and has no domain, and the prepared binding says so by carrying a null path and a null scale. Filling them with a placeholder would put a field name in a legend that names no field.
Properties ​
channel ​
readonlychannel:Channel
Defined in: graphty-element/src/session/styles/legend.ts:141
The channel the block describes.
departures ​
readonlydepartures: readonlystring[]
Defined in: graphty-element/src/session/styles/legend.ts:221
What this encoding does that the picture alone does not admit to.
Finished sentences, printed unedited. Empty when the encoding has nothing to confess.
domain? ​
readonlyoptionaldomain?:object
Defined in: graphty-element/src/session/styles/legend.ts:165
The extent values were read against, and how it was narrowed.
clamped? ​
readonlyoptionalclamped?:object
The percentiles the extent was cut at, when the binding asked for a clamp.
clamped.from ​
readonlyfrom:string
The low percentile, such as "p2".
clamped.to ​
readonlyto:string
The high percentile, such as "p98".
max ​
readonlymax:number
The high end.
midpoint? ​
readonlyoptionalmidpoint?:number
The value a diverging palette centres on, when the binding named one.
min ​
readonlymin:number
The low end.
field? ​
readonlyoptionalfield?:object
Defined in: graphty-element/src/session/styles/legend.ts:149
The field the encoding reads, in both plain and technical words.
path ​
readonlypath:string
The column path itself.
plainName ​
readonlyplainName:string
The name a reader sees.
technicalName ​
readonlytechnicalName:string
The name the literature and the data use.
kind ​
readonlykind:"literal"|"categorical"|"highlight"|"sequential"|"diverging"
Defined in: graphty-element/src/session/styles/legend.ts:147
What shape of legend a consumer draws: a ramp, a list of colours, a single chip.
layerId ​
readonlylayerId:string
Defined in: graphty-element/src/session/styles/legend.ts:143
The layer that paints it.
overflow? ​
readonlyoptionaloverflow?:object
Defined in: graphty-element/src/session/styles/legend.ts:212
How many rows did not fit, when some did not. The "other" row is never counted here.
hidden ​
readonlyhidden:number
How many rows were left out.
palette? ​
readonlyoptionalpalette?:object
Defined in: graphty-element/src/session/styles/legend.ts:203
The palette, when the channel carries a colour.
name ​
readonlyname:PaletteId
The palette's id.
reversed ​
readonlyreversed:boolean
Whether the smallest value lands at the far end of it.
range? ​
readonlyoptionalrange?:object
Defined in: graphty-element/src/session/styles/legend.ts:196
The range the binding maps values onto, in the channel's own units ("1 to 3" for a node size; node size is unitless, never pixels). Present only for a channel that carries a number, such as node.size or edge.width, and absent when the binding's map or other paints values of its own, which the range does not bound. It is the binding's range, not the smallest and largest swatch: a reversed binding still reads low to high here, and the swatches are only samples of it.
max ​
readonlymax:number
The high end.
min ​
readonlymin:number
The low end.
Since ​
3.10.0
reading? ​
readonlyoptionalreading?:LegendReading
Defined in: graphty-element/src/session/styles/legend.ts:186
What a higher value means on the drawing. Present only for an encoding that reads a numeric domain and paints its two ends differently in one direction: absent for categories, for a diverging palette (both ends are strong), for a fixed value and for a domain of one value.
Since ​
3.10.0
runId? ​
readonlyoptionalrunId?:string
Defined in: graphty-element/src/session/styles/legend.ts:145
The run behind the layer, when a run put it there.
scale? ​
readonlyoptionalscale?:object
Defined in: graphty-element/src/session/styles/legend.ts:158
The scale, by name and in words.
kind ​
readonlykind:string
The scale's name, which is what a binding spells.
label ​
readonlylabel:string
The same scale in words, from the scale catalogue.
swatches ​
readonlyswatches: readonlyLegendSwatch[]
Defined in: graphty-element/src/session/styles/legend.ts:210
Up to twelve rows, plus the "other" row when the paint folded some groups.