Skip to content

BehaviorManager

class

Back to Helios Web API

Kind
class
Source
src/behaviors/BehaviorManager.js:17

Description

Runtime owner for active behavior instances on a Helios visualization.

Signature

export class BehaviorManager {

Parameters

NameTypeAttributesDefaultDescription
heliosimport('../Helios.js').HeliosVisualization controller that behaviors will attach to.
registryBehaviorRegistryRegistry used to instantiate named behaviors.

Returns

Manager with no active behaviors attached.

Type BehaviorManager

Notes

The manager creates, attaches, detaches, serializes, and restores behavior instances against a shared Helios context. Use the higher-level helios.behavior namespace for most app code.

Lifecycle

Creation, initialization, prewarming, cleanup, and renderer lifetime.

destroy()

Source: src/behaviors/BehaviorManager.js:92

Manages destroy for the current instance.

Network And Persistence

Network replacement, serialization, and visualization state persistence. ExporterBehavior and InterfaceBehavior can surface parts of this flow in the UI.

serialize()

Source: src/behaviors/BehaviorManager.js:98

Handles serialize for the current graph or visualization state.

restore(snapshot = {}) → {this}

Source: src/behaviors/BehaviorManager.js:107

Updates the restore state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
snapshotoptional{}Value passed to restore.

Returns

This instance.

Type this

Configuration

General configuration setters and compatibility helpers.

setUI(ui) → {this}

Source: src/behaviors/BehaviorManager.js:26

Set the ui setting.

Parameters

NameTypeAttributesDefaultDescription
uiValue passed to setUI.

Returns

This instance.

Type this

get(id)

Source: src/behaviors/BehaviorManager.js:35

Returns the current get value or state.

Parameters

NameTypeAttributesDefaultDescription
idValue passed to get.

Utilities

Additional public helpers that do not belong to a narrower API area.

has(id)

Source: src/behaviors/BehaviorManager.js:31

Returns the current has value or state.

Parameters

NameTypeAttributesDefaultDescription
idValue passed to has.

entries()

Source: src/behaviors/BehaviorManager.js:39

Configures or reads entries.

values()

Source: src/behaviors/BehaviorManager.js:43

Configures or reads values.

use(idOrBehavior, options = {}) → {this}

Source: src/behaviors/BehaviorManager.js:47

Manages use for the current instance.

Parameters

NameTypeAttributesDefaultDescription
idOrBehaviorValue passed to use.
optionsObjectoptional{}Options object for this operation.

Returns

This instance.

Type this

detach(id)

Source: src/behaviors/BehaviorManager.js:68

Manages detach for the current instance.

Parameters

NameTypeAttributesDefaultDescription
idValue passed to detach.

detachAll()

Source: src/behaviors/BehaviorManager.js:79

Manages all for the current instance.