@graphty/graphty-element / schema / LabelStyle
Interface: LabelStyle ​
Defined in: graphty-element/src/catalog/label-style.ts:66
How a label is drawn.
Properties ​
animation? ​
optionalanimation?:LabelAnimation
Defined in: graphty-element/src/catalog/label-style.ts:154
How the label moves.
animationSpeed? ​
optionalanimationSpeed?:number
Defined in: graphty-element/src/catalog/label-style.ts:156
How fast it moves, as a multiple of the animation's own speed.
attachOffset? ​
optionalattachOffset?:number
Defined in: graphty-element/src/catalog/label-style.ts:115
How far from the node or edge it sits, in world units.
background? ​
optionalbackground?:string
Defined in: graphty-element/src/catalog/label-style.ts:94
The colour of the panel behind the words.
badge? ​
optionalbadge?:LabelBadge
Defined in: graphty-element/src/catalog/label-style.ts:166
A badge drawn in place of, or beside, the words.
borderColor? ​
optionalborderColor?:string
Defined in: graphty-element/src/catalog/label-style.ts:102
The colour of that border.
borderWidth? ​
optionalborderWidth?:number
Defined in: graphty-element/src/catalog/label-style.ts:100
How thick a border is drawn around the panel; zero draws none.
color? ​
optionalcolor?:string
Defined in: graphty-element/src/catalog/label-style.ts:87
The colour of the letters.
cornerRadius? ​
optionalcornerRadius?:number
Defined in: graphty-element/src/catalog/label-style.ts:98
How far the panel's corners are rounded.
depthFade? ​
optionaldepthFade?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:159
Whether the label fades out as the camera moves away from it.
depthFadeFar? ​
optionaldepthFadeFar?:number
Defined in: graphty-element/src/catalog/label-style.ts:163
How far away the camera has to be for the label to have faded out entirely.
depthFadeNear? ​
optionaldepthFadeNear?:number
Defined in: graphty-element/src/catalog/label-style.ts:161
How close the camera has to be for the label to be drawn at full strength.
enabled? ​
optionalenabled?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:78
Whether the label is drawn at all.
Writing the words through node.label or edge.label switches a label on. Written false, this switches one back OFF while leaving its text resolved -- which is how a layer hides labels on part of a graph without taking the words away from the layers under it.
Written true on node.labelStyle with no node.label anywhere in the stack, it switches node labels on with the element's own words, which are each node's id. A layer that only wants labels on never has to name an attribute to draw.
font? ​
optionalfont?:string
Defined in: graphty-element/src/catalog/label-style.ts:81
The typeface, as a CSS font family.
gradient? ​
optionalgradient?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:104
Whether the panel is filled with a gradient rather than a single colour.
gradientColors? ​
optionalgradientColors?: readonlystring[]
Defined in: graphty-element/src/catalog/label-style.ts:108
The colours the gradient runs through, in order.
gradientDirection? ​
optionalgradientDirection?:LabelGradientDirection
Defined in: graphty-element/src/catalog/label-style.ts:110
Which way a linear gradient runs.
gradientType? ​
optionalgradientType?:LabelGradientType
Defined in: graphty-element/src/catalog/label-style.ts:106
Whether that gradient runs in a line or out from the centre.
icon? ​
optionalicon?:string
Defined in: graphty-element/src/catalog/label-style.ts:168
The glyph a badge draws when it is an icon badge.
iconPosition? ​
optionaliconPosition?:LabelIconPosition
Defined in: graphty-element/src/catalog/label-style.ts:170
Which side of the words that icon sits on.
lineHeight? ​
optionallineHeight?:number
Defined in: graphty-element/src/catalog/label-style.ts:89
The gap between one line of text and the next, as a multiple of the font size.
location? ​
optionallocation?:LabelLocation
Defined in: graphty-element/src/catalog/label-style.ts:113
Where the label sits relative to its node or edge.
marginBottom? ​
optionalmarginBottom?:number
Defined in: graphty-element/src/catalog/label-style.ts:119
Empty space below the panel.
marginLeft? ​
optionalmarginLeft?:number
Defined in: graphty-element/src/catalog/label-style.ts:121
Empty space to the left of the panel.
marginRight? ​
optionalmarginRight?:number
Defined in: graphty-element/src/catalog/label-style.ts:123
Empty space to the right of the panel.
marginTop? ​
optionalmarginTop?:number
Defined in: graphty-element/src/catalog/label-style.ts:117
Empty space above the panel.
maxNumber? ​
optionalmaxNumber?:number
Defined in: graphty-element/src/catalog/label-style.ts:182
The largest number drawn in full before the suffix takes over.
outline? ​
optionaloutline?:string
Defined in: graphty-element/src/catalog/label-style.ts:139
The colour of an outline around each letter; writing one is what switches the outline on.
outlineWidth? ​
optionaloutlineWidth?:number
Defined in: graphty-element/src/catalog/label-style.ts:141
How thick that outline is drawn.
overflowSuffix? ​
optionaloverflowSuffix?:string
Defined in: graphty-element/src/catalog/label-style.ts:184
What is drawn after a shortened number.
padding? ​
optionalpadding?:number
Defined in: graphty-element/src/catalog/label-style.ts:96
How much room there is between the words and the edge of that panel.
pointer? ​
optionalpointer?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:126
Whether a speech-bubble pointer comes out of the panel.
pointerCurve? ​
optionalpointerCurve?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:136
Whether the pointer's sides are drawn as curves rather than straight lines.
pointerDirection? ​
optionalpointerDirection?:LabelPointerDirection
Defined in: graphty-element/src/catalog/label-style.ts:128
Which side it comes out of.
pointerHeight? ​
optionalpointerHeight?:number
Defined in: graphty-element/src/catalog/label-style.ts:132
How far the pointer reaches away from the panel.
pointerOffset? ​
optionalpointerOffset?:number
Defined in: graphty-element/src/catalog/label-style.ts:134
How far along that side the pointer sits, from the middle.
pointerWidth? ​
optionalpointerWidth?:number
Defined in: graphty-element/src/catalog/label-style.ts:130
How wide the pointer is where it meets the panel.
progress? ​
optionalprogress?:number
Defined in: graphty-element/src/catalog/label-style.ts:172
How full a progress badge is drawn, from 0 to 1.
shadow? ​
optionalshadow?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:143
Whether the letters cast a shadow.
shadowBlur? ​
optionalshadowBlur?:number
Defined in: graphty-element/src/catalog/label-style.ts:147
How far the shadow is blurred.
shadowColor? ​
optionalshadowColor?:string
Defined in: graphty-element/src/catalog/label-style.ts:145
The colour of that shadow.
shadowOffsetX? ​
optionalshadowOffsetX?:number
Defined in: graphty-element/src/catalog/label-style.ts:149
How far the shadow is thrown to the right.
shadowOffsetY? ​
optionalshadowOffsetY?:number
Defined in: graphty-element/src/catalog/label-style.ts:151
How far the shadow is thrown downwards.
sizePx? ​
optionalsizePx?:number
Defined in: graphty-element/src/catalog/label-style.ts:83
How tall the letters are drawn on the label's own canvas.
smartOverflow? ​
optionalsmartOverflow?:boolean
Defined in: graphty-element/src/catalog/label-style.ts:180
Whether a number too large to show is shortened rather than drawn in full.
With this on, a label reading a count above LabelStyle.maxNumber is drawn as that maximum followed by LabelStyle.overflowSuffix -- 99+ rather than 1500.
textAlign? ​
optionaltextAlign?:LabelTextAlign
Defined in: graphty-element/src/catalog/label-style.ts:91
How the lines are lined up against each other.
weight? ​
optionalweight?:number|"normal"|"bold"
Defined in: graphty-element/src/catalog/label-style.ts:85
How heavy the letters are.