LegendsBehavior
- Kind
- class
- Source
- src/behaviors/LegendsBehavior.js:109
Description
Built-in behavior for legend overlays.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | Legend visibility, placement, typography, scale, title, and export compatibility options. |
Returns
Behavior controlling SVG legends for mapper and density channels.
TypeLegendsBehaviorNotes
Legends read mapper and density configuration from the live Helios instance and preserve serializable placement, title, and visibility state.
Instance Properties
id
Source: src/behaviors/LegendsBehavior.js:110
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/LegendsBehavior.js:269
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/LegendsBehavior.js:122
Configures or reads attach.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context | Value passed to attach. |
serialize()
Source: src/behaviors/LegendsBehavior.js:166
Handles serialize for the current graph or visualization state.
restore(snapshot = {}) → {this}
Source: src/behaviors/LegendsBehavior.js:262
Updates the restore state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
snapshot | optional | {} | Value passed to restore. |
Returns
This instance.
TypethisAppearance
Visual rendering settings for nodes, edges, labels, legends, density, shading, and background. AppearanceBehavior, LabelsBehavior, and LegendsBehavior cover the built-in controls.
getLegendItems(options = {}) → {Object|this}
Source: src/behaviors/LegendsBehavior.js:298
Read or set the get legend items setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
Returns
Current get legend items value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.getLegendItems({
enabled: true,
});
Utilities
Additional public helpers that do not belong to a narrower API area.
update(options = {}, changeOptions = {})
Source: src/behaviors/LegendsBehavior.js:144
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/LegendsBehavior.js:172
Configures or reads state entries.
emitChange(reason, detail = {})
Source: src/behaviors/LegendsBehavior.js:273
Configures or reads emit change.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | Reason for this operation. | ||
detail | optional | {} | Event payload passed to listeners. |
legends(options) → {Object|this}
Source: src/behaviors/LegendsBehavior.js:277
Read or set the legends setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | Options object for this operation. |
Returns
Current legends value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.legends({
enabled: true,
});
enabled(value) → {boolean|this}
Source: src/behaviors/LegendsBehavior.js:283
Read or set the enabled setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | boolean | New enabled value. Omit this argument to read the current value. |
Returns
Current enabled value when called without arguments; otherwise this instance for chaining.
Typeboolean|thisExample
helios.enabled(true);
titles(value) → {Object|this}
Source: src/behaviors/LegendsBehavior.js:288
Read or set the titles setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New titles value. Omit this argument to read the current value. |
Returns
Current titles value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.titles(1);
placements(value) → {Object|this}
Source: src/behaviors/LegendsBehavior.js:293
Read or set the placements setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New placements value. Omit this argument to read the current value. |
Returns
Current placements value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.placements(1);
applyConfig({ silent = false } = {})
Source: src/behaviors/LegendsBehavior.js:312
Updates the config state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
silent | optional | false } = {} | Value passed to applyConfig. |