LabelsBehavior
- Kind
- class
- Source
- src/behaviors/LabelsBehavior.js:108
Description
Built-in behavior for SVG label overlays.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | Label options including enabled, source, selectionMode, maxVisible, collision settings, font settings, and export compatibility flags. |
Returns
Behavior controlling the live label overlay.
TypeLabelsBehaviorNotes
Labels can be driven by a node attribute, callback, selection state, hover state, and screen-space collision/ranking limits.
Instance Properties
id
Source: src/behaviors/LabelsBehavior.js:109
Id exposed by the class.
Filtering And State
Graph filtering and interaction state. When active, FilterBehavior and SelectionBehavior coordinate this area.
getPublicState()
Source: src/behaviors/LabelsBehavior.js:351
Returns the current public state value or state.
Example
const value = helios.getPublicState();
Network And Persistence
Network replacement, serialization, and visualization state persistence. ExporterBehavior and InterfaceBehavior can surface parts of this flow in the UI.
attach(context)
Source: src/behaviors/LabelsBehavior.js:123
Configures or reads attach.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context | Value passed to attach. |
serialize()
Source: src/behaviors/LabelsBehavior.js:153
Handles serialize for the current graph or visualization state.
restore(snapshot = {}) → {this}
Source: src/behaviors/LabelsBehavior.js:344
Updates the restore state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
snapshot | optional | {} | Value passed to restore. |
Returns
This instance.
TypethisCamera And View
Camera framing, target following, dimensional mode, and transitions. InterfaceBehavior can expose these controls.
mode(value, options = {})
Source: src/behaviors/LabelsBehavior.js:385
Configures or reads mode.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | string | New mode value. Omit this argument to read the current value. | ||
options | Object | optional | {} | Options object for this operation. |
Example
helios.mode('auto');
Appearance
Visual rendering settings for nodes, edges, labels, legends, density, shading, and background. AppearanceBehavior, LabelsBehavior, and LegendsBehavior cover the built-in controls.
fontSizeScale(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:408
Read or set the font size scale setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New font size scale value. Omit this argument to read the current value. |
Returns
Current font size scale value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.fontSizeScale(1);
outlineWidth(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:422
Read or set the outline width setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New outline width value. Omit this argument to read the current value. |
Returns
Current outline width value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.outlineWidth(1);
outlineColor(value) → {string|Array<number>|this}
Source: src/behaviors/LabelsBehavior.js:462
Read or set the outline color setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | string|Array<number> | New outline color value. Omit this argument to read the current value. |
Returns
Current outline color value when called without arguments; otherwise this instance for chaining.
Typestring|Array<number>|thisExample
helios.outlineColor('#4aa3ff');
Configuration
General configuration setters and compatibility helpers.
setHoverPolicy({ enabled = false, source = null } = {}) → {this}
Source: src/behaviors/LabelsBehavior.js:487
Set the hover policy setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enabled | optional | false | Value passed to setHoverPolicy. | |
source | Blob|ArrayBuffer|string|File | optional | null } = {} | Network or input source used by the operation. |
Returns
This instance.
TypethisclearHoverPolicy(options = {}) → {Object|this}
Source: src/behaviors/LabelsBehavior.js:497
Read or set the clear hover policy setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
Returns
Current clear hover policy value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.clearHoverPolicy({
enabled: true,
});
Utilities
Additional public helpers that do not belong to a narrower API area.
update(options = {}, changeOptions = {})
Source: src/behaviors/LabelsBehavior.js:135
Configures or reads update.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
changeOptions | optional | {} | Value passed to update. |
Example
helios.update({
enabled: true,
});
stateEntries()
Source: src/behaviors/LabelsBehavior.js:159
Configures or reads state entries.
emitChange(reason, detail = {})
Source: src/behaviors/LabelsBehavior.js:360
Configures or reads emit change.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | Reason for this operation. | ||
detail | optional | {} | Event payload passed to listeners. |
labels(options) → {Object|this}
Source: src/behaviors/LabelsBehavior.js:364
Read or set the labels setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | Options object for this operation. |
Returns
Current labels value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.labels({
enabled: true,
});
enabled(value, options = {}) → {this}
Source: src/behaviors/LabelsBehavior.js:380
Configures or reads enabled.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | boolean | New enabled value. Omit this argument to read the current value. | ||
options | Object | optional | {} | Options object for this operation. |
Returns
This instance.
TypethisExample
helios.enabled(true);
selectedOnlySpaceAware(value) → {Object|this}
Source: src/behaviors/LabelsBehavior.js:398
Read or set the selected only space aware setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New selected only space aware value. Omit this argument to read the current value. |
Returns
Current selected only space aware value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.selectedOnlySpaceAware(1);
maxVisible(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:403
Read or set the max visible setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New max visible value. Omit this argument to read the current value. |
Returns
Current max visible value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.maxVisible(1);
minScreenRadius(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:415
Read or set the min screen radius setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New min screen radius value. Omit this argument to read the current value. |
Returns
Current min screen radius value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.minScreenRadius(1);
offsetRadiusFactor(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:429
Read or set the offset radius factor setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New offset radius factor value. Omit this argument to read the current value. |
Returns
Current offset radius factor value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.offsetRadiusFactor(1);
offsetPx(value) → {Object|this}
Source: src/behaviors/LabelsBehavior.js:436
Read or set the offset px setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New offset px value. Omit this argument to read the current value. |
Returns
Current offset px value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.offsetPx(1);
maxChars(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:443
Read or set the max chars setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New max chars value. Omit this argument to read the current value. |
Returns
Current max chars value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.maxChars(1);
maxRows(value) → {number|this}
Source: src/behaviors/LabelsBehavior.js:450
Read or set the max rows setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | New max rows value. Omit this argument to read the current value. |
Returns
Current max rows value when called without arguments; otherwise this instance for chaining.
Typenumber|thisExample
helios.maxRows(1);
fill(value) → {Object|this}
Source: src/behaviors/LabelsBehavior.js:457
Read or set the fill setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New fill value. Omit this argument to read the current value. |
Returns
Current fill value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.fill(1);
fontFamily(value) → {string|this}
Source: src/behaviors/LabelsBehavior.js:467
Read or set the font family setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | string | New font family value. Omit this argument to read the current value. |
Returns
Current font family value when called without arguments; otherwise this instance for chaining.
Typestring|thisExample
helios.fontFamily('auto');
source(value) → {string|this}
Source: src/behaviors/LabelsBehavior.js:472
Read or set the source setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | string | New source value. Omit this argument to read the current value. |
Returns
Current source value when called without arguments; otherwise this instance for chaining.
Typestring|thisExample
helios.source('auto');
applySelectionDefaults()
Source: src/behaviors/LabelsBehavior.js:479
Updates the selection defaults state on the current instance.
applyConfig({ silent = false } = {})
Source: src/behaviors/LabelsBehavior.js:504
Updates the config state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
silent | optional | false } = {} | Value passed to applyConfig. |