LayoutBehavior
- Kind
- class
- Source
- src/behaviors/LayoutBehavior.js:338
Description
Built-in behavior for choosing and controlling the active layout.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | Layout options such as layoutType, positionAttribute, low-level parameters, and running state. |
Returns
Behavior wrapping static, worker, D3 force, and GPU force layouts.
TypeLayoutBehaviorNotes
Use this behavior when UI or persistence needs to switch layouts, copy numeric position attributes into current positions, or start/stop a dynamic layout without replacing the Helios instance.
Instance Properties
id
Source: src/behaviors/LayoutBehavior.js:339
Id exposed by the class.
Filtering And State
Graph filtering and interaction state. When active, FilterBehavior and SelectionBehavior coordinate this area.
refreshParameterStateEntries()
Source: src/behaviors/LayoutBehavior.js:508
Configures or reads refresh parameter state entries.
refreshPauseOnInteractionStateEntry()
Source: src/behaviors/LayoutBehavior.js:518
Configures or reads refresh pause on interaction state entry.
getPublicState()
Source: src/behaviors/LayoutBehavior.js:577
Returns the current public state value or state.
Example
const value = helios.getPublicState();
runState()
Source: src/behaviors/LayoutBehavior.js:610
Configures or reads run state.
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/LayoutBehavior.js:357
Configures or reads attach.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context | Value passed to attach. |
serialize()
Source: src/behaviors/LayoutBehavior.js:418
Handles serialize for the current graph or visualization state.
restore(snapshot = {}) → {this}
Source: src/behaviors/LayoutBehavior.js:527
Updates the restore state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
snapshot | optional | {} | Value passed to restore. |
Returns
This instance.
TypethisLayout And Positions
Layout selection, position sources, interpolation, and position snapshots. LayoutBehavior handles the built-in layout UI.
applyPositionAttribute(value = this.state.positionAttribute, options = {})
Source: src/behaviors/LayoutBehavior.js:849
Updates the position attribute state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | optional | this.state.positionAttribute | New apply position attribute value. Omit this argument to read the current value. | |
options | Object | optional | {} | Options object for this operation. |
Example
helios.applyPositionAttribute(1);
Configuration
General configuration setters and compatibility helpers.
reset(options = {}) → {Object|this}
Source: src/behaviors/LayoutBehavior.js:893
Read or set the reset setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
Returns
Current reset value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.reset({
enabled: true,
});
Utilities
Additional public helpers that do not belong to a narrower API area.
update(options = {}) → {Object|this}
Source: src/behaviors/LayoutBehavior.js:381
Read or set the update setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
Returns
Current update value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.update({
enabled: true,
});
stateEntries()
Source: src/behaviors/LayoutBehavior.js:430
Configures or reads state entries.
emitChange(reason, detail = {})
Source: src/behaviors/LayoutBehavior.js:572
Configures or reads emit change.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | Reason for this operation. | ||
detail | optional | {} | Event payload passed to listeners. |
descriptor()
Source: src/behaviors/LayoutBehavior.js:598
Configures or reads descriptor.
choices()
Source: src/behaviors/LayoutBehavior.js:602
Configures or reads choices.
bindings()
Source: src/behaviors/LayoutBehavior.js:606
Configures or reads bindings.
isDynamic()
Source: src/behaviors/LayoutBehavior.js:614
Returns the current dynamic value or state.
Example
const value = helios.isDynamic();
type(value, options = {})
Source: src/behaviors/LayoutBehavior.js:618
Configures or reads type.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New type value. Omit this argument to read the current value. | |||
options | Object | optional | {} | Options object for this operation. |
Example
helios.type(1);
parameter(key, value, options = {})
Source: src/behaviors/LayoutBehavior.js:639
Configures or reads parameter.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
key | Value passed to parameter. | |||
value | New parameter value. Omit this argument to read the current value. | |||
options | Object | optional | {} | Options object for this operation. |
parameters(patch = {}, options = {})
Source: src/behaviors/LayoutBehavior.js:656
Configures or reads parameters.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
patch | optional | {} | Value passed to parameters. | |
options | Object | optional | {} | Options object for this operation. |
pauseOnInteraction(value, options = {})
Source: src/behaviors/LayoutBehavior.js:671
Configures or reads pause on interaction.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New pause on interaction value. Omit this argument to read the current value. | |||
options | Object | optional | {} | Options object for this operation. |
Example
helios.pauseOnInteraction(1);
positionAttribute(value, options = {})
Source: src/behaviors/LayoutBehavior.js:832
Configures or reads position attribute.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New position attribute value. Omit this argument to read the current value. | |||
options | Object | optional | {} | Options object for this operation. |
Example
helios.positionAttribute(1);
positionAttributeChoices()
Source: src/behaviors/LayoutBehavior.js:842
Configures or reads position attribute choices.
start()
Source: src/behaviors/LayoutBehavior.js:869
Configures or reads start.
stop(reason = 'behavior:layout')
Source: src/behaviors/LayoutBehavior.js:876
Configures or reads stop.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | optional | 'behavior:layout' | Reason for this operation. |
reheat(reason = 'behavior:layout')
Source: src/behaviors/LayoutBehavior.js:882
Configures or reads reheat.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | optional | 'behavior:layout' | Reason for this operation. |