@graphty/graphty-element / session / ColumnEncodingSpec
Interface: ColumnEncodingSpec ​
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:146
What encode() is asked for when it colors or sizes by a plain data column: an EncodingSpec with a column in place of the run.
Whatever is left off -- the scale, the palette, the range, the overflow -- is chosen from what the column measures when the layer is created, and written into it. A saved layer therefore always draws what it says, whatever the data or a later declaration does.
Extends ​
Properties ​
channel ​
readonlychannel:Channel
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:80
The channel to paint.
Inherited from ​
clamp? ​
readonlyoptionalclamp?: [number,number]
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:116
Percentiles to cut the extent at, so a few outliers do not flatten everything else.
Inherited from ​
column ​
readonlycolumn:ColumnRef
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:148
The column; an AttributeDescriptor from session.data.attributes() can be passed as is.
domain? ​
readonlyoptionaldomain?:"auto"| [number,number]
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:114
The extent to read values against. Defaults to the extent the run measured.
Inherited from ​
missing? ​
readonlyoptionalmissing?: {value:string|number; } |"skip"
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:125
What an element with no value is painted. Defaults to "skip", which is to leave it alone.
Inherited from ​
name? ​
readonlyoptionalname?:string
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:129
What to call the layer. Defaults to the run's label and the channel's plain name.
Inherited from ​
overflow? ​
readonlyoptionaloverflow?:BindingOverflow
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:112
What a categorical colour encoding does when the run found more groups than the palette has colours (8 for the default palette). Ignored for a measurement, which has no groups.
"other"-- THE DEFAULT. The 8 largest groups keep the palette's colours in palette order, largest first, and every remaining group is painted one grey (#686868), which the legend lists as its last row, markedrole: "other"."shape"-- node encodings only. Colours cycle through the palette and each full cycle moves to the next node shape: group i is colour i mod 8 and shape floor(i / 8) from icosphere (the default shape), box, octahedron, cylinder, cone, torus. Groups past 48 fold into the grey. The shape is written by the same layer, so it is added and removed with the colour. Refused withE_BAD_COMMANDon an edge channel, since an edge has no shape."extend"-- every group gets a colour of its own: a larger categorical palette when one fits, and past that the sequential default sampled once per group. Colours past the palette's capacity are NOT guaranteed to be told apart.
With a palette named, N is that palette's capacity. A named palette with NO overflow keeps the strict rule: too many groups is refused with E_CAP_EXCEEDED, because the caller asked for exactly those colours. Naming an overflow applies it instead.
Inherited from ​
palette? ​
readonlyoptionalpalette?:PaletteId
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:91
The palette.
Left off, the element picks one when the layer is painted, from the groups the run actually produced: a ramp for a measurement, and for groups the smallest palette in the catalogue that can name them all. Named, it is honoured as named -- and refused if the run has more groups than it has colours, because a categorical palette never wraps.
Inherited from ​
range? ​
readonlyoptionalrange?: [number,number]
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:123
The numbers a numeric channel answers in, such as [1, 5] for a node size. On node.size and edge.width with no scale named, an amount defaults to [1, 3] -- the default size to three times it, the same range a column of amounts gets -- and that range is written into the layer. Anywhere else it defaults to the unit interval.
Inherited from ​
reverse? ​
readonlyoptionalreverse?:boolean
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:127
Send the smallest value to the far end of the range instead of the near end.
Inherited from ​
scale? ​
readonlyoptionalscale?:"linear"|string&object|"ordinal"|"log"|"neglog10"|"sqrt"|"pow"|"bins"|"quantile"|"passthrough"
Defined in: graphty-element/src/session/styles/EncodingSpec.ts:82
The scale to read the values through. Defaults to one that suits the field.