@graphty/graph-io / styles / Mapping
Type Alias: Mapping ​
Mapping = {
by:ColumnRef;kind:"passthrough"; } | {by:ColumnRef;kind:"discrete";table: readonly readonly [Scalar,StyleValue][]; } | {by:ColumnRef;kind:"continuous";points: readonlyContinuousPoint[];step?:number; }
Defined in: styles/types.ts:1032
How a rule turns an element's value into a style value. A discrete table's absent key, a passthrough's null and a continuous mapping over a missing or non-numeric value give no result, and the rules beneath decide. Open union.
Union Members ​
Type Literal ​
{ by: ColumnRef; kind: "passthrough"; }
by ​
readonlyby:ColumnRef
The column read.
kind ​
readonlykind:"passthrough"
The column's value is the style value.
Type Literal ​
{ by: ColumnRef; kind: "discrete"; table: readonly readonly [Scalar, StyleValue][]; }
by ​
readonlyby:ColumnRef
The column read.
kind ​
readonlykind:"discrete"
A table from the column's value to the style value.
table ​
readonlytable: readonly readonly [Scalar,StyleValue][]
[key, style value] pairs; a list value matches by its first item that has an entry.
Type Literal ​
{ by: ColumnRef; kind: "continuous"; points: readonly ContinuousPoint[]; step?: number; }
by ​
readonlyby:ColumnRef
The column read; it must hold numbers.
kind ​
readonlykind:"continuous"
Points between which numbers and colors are interpolated.
points ​
readonlypoints: readonlyContinuousPoint[]
The points, in increasing at.
step? ​
readonlyoptionalstep?:number
When set, a number the mapping gives is rounded to the nearest multiple of step, as the writing tool draws a property that holds whole numbers (Cytoscape's font size: 1; its 0..255 transparency: 1/255).