LayoutBehavior
- Kind
- class
- Source
- src/behaviors/LayoutBehavior.js:297
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:298
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:433
Configures or reads refresh parameter state entries.
getPublicState()
Source: src/behaviors/LayoutBehavior.js:465
Returns the current public state value or state.
Example
const value = helios.getPublicState();
runState()
Source: src/behaviors/LayoutBehavior.js:496
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:308
Configures or reads attach.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context | Value passed to attach. |
serialize()
Source: src/behaviors/LayoutBehavior.js:345
Handles serialize for the current graph or visualization state.
restore(snapshot = {}) → {this}
Source: src/behaviors/LayoutBehavior.js:443
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:574
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:618
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:322
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:356
Configures or reads state entries.
emitChange(reason, detail = {})
Source: src/behaviors/LayoutBehavior.js:460
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:484
Configures or reads descriptor.
choices()
Source: src/behaviors/LayoutBehavior.js:488
Configures or reads choices.
bindings()
Source: src/behaviors/LayoutBehavior.js:492
Configures or reads bindings.
isDynamic()
Source: src/behaviors/LayoutBehavior.js:500
Returns the current dynamic value or state.
Example
const value = helios.isDynamic();
type(value, options = {})
Source: src/behaviors/LayoutBehavior.js:504
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:525
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:542
Configures or reads parameters.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
patch | optional | {} | Value passed to parameters. | |
options | Object | optional | {} | Options object for this operation. |
positionAttribute(value, options = {})
Source: src/behaviors/LayoutBehavior.js:557
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:567
Configures or reads position attribute choices.
start()
Source: src/behaviors/LayoutBehavior.js:594
Configures or reads start.
stop(reason = 'behavior:layout')
Source: src/behaviors/LayoutBehavior.js:601
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:607
Configures or reads reheat.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | optional | 'behavior:layout' | Reason for this operation. |