Skip to content

LayoutBehavior

class

Back to Helios Web API

Kind
class
Source
src/behaviors/LayoutBehavior.js:297

Description

Built-in behavior for choosing and controlling the active layout.

Signature

export class LayoutBehavior extends Behavior {

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptionalLayout options such as layoutType, positionAttribute, low-level parameters, and running state.

Returns

Behavior wrapping static, worker, D3 force, and GPU force layouts.

Type LayoutBehavior

Notes

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

NameTypeAttributesDefaultDescription
contextValue 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

NameTypeAttributesDefaultDescription
snapshotoptional{}Value passed to restore.

Returns

This instance.

Type this

Layout 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

NameTypeAttributesDefaultDescription
valueoptionalthis.state.positionAttributeNew apply position attribute value. Omit this argument to read the current value.
optionsObjectoptional{}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

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current reset value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


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

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current update value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


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

NameTypeAttributesDefaultDescription
reasonstringReason for this operation.
detailoptional{}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

NameTypeAttributesDefaultDescription
valueNew type value. Omit this argument to read the current value.
optionsObjectoptional{}Options object for this operation.

Example


helios.type(1);

parameter(key, value, options = {})

Source: src/behaviors/LayoutBehavior.js:525

Configures or reads parameter.

Parameters

NameTypeAttributesDefaultDescription
keyValue passed to parameter.
valueNew parameter value. Omit this argument to read the current value.
optionsObjectoptional{}Options object for this operation.

parameters(patch = {}, options = {})

Source: src/behaviors/LayoutBehavior.js:542

Configures or reads parameters.

Parameters

NameTypeAttributesDefaultDescription
patchoptional{}Value passed to parameters.
optionsObjectoptional{}Options object for this operation.

positionAttribute(value, options = {})

Source: src/behaviors/LayoutBehavior.js:557

Configures or reads position attribute.

Parameters

NameTypeAttributesDefaultDescription
valueNew position attribute value. Omit this argument to read the current value.
optionsObjectoptional{}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

NameTypeAttributesDefaultDescription
reasonstringoptional'behavior:layout'Reason for this operation.

reheat(reason = 'behavior:layout')

Source: src/behaviors/LayoutBehavior.js:607

Configures or reads reheat.

Parameters

NameTypeAttributesDefaultDescription
reasonstringoptional'behavior:layout'Reason for this operation.