Skip to content

HoverBehavior

class

Back to Helios Web API

Kind
class
Source
src/behaviors/HoverBehavior.js:34

Description

Built-in behavior for hover picking and hover labels.

Signature

export class HoverBehavior extends Behavior {

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptionalHover options including nodeHover, edgeHover, hoverLabel, and connected-edge highlighting.

Returns

Behavior that tracks the current hovered node and edge.

Type HoverBehavior

Notes

Hover requires picking to be available on the active renderer. The behavior coordinates with LabelsBehavior when transient hover labels are enabled.

Instance Properties

id

Source: src/behaviors/HoverBehavior.js:35

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/HoverBehavior.js:179

Returns the current public state value or state.

Example


const value = helios.getPublicState();

ensureStateStyleDefaults()

Source: src/behaviors/HoverBehavior.js:183

Configures or reads ensure state style defaults.

applyOtherElementsState()

Source: src/behaviors/HoverBehavior.js:203

Updates the other elements state state on 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.

attach(context)

Source: src/behaviors/HoverBehavior.js:62

Configures or reads attach.

Parameters

NameTypeAttributesDefaultDescription
contextValue passed to attach.

serialize()

Source: src/behaviors/HoverBehavior.js:147

Handles serialize for the current graph or visualization state.

restore(snapshot = {}) → {this}

Source: src/behaviors/HoverBehavior.js:166

Updates the restore state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
snapshotoptional{}Value passed to restore.

Returns

This instance.

Type this

handleNetworkReplaced()

Source: src/behaviors/HoverBehavior.js:257

Configures or reads handle network replaced.

Appearance

Visual rendering settings for nodes, edges, labels, legends, density, shading, and background. AppearanceBehavior, LabelsBehavior, and LegendsBehavior cover the built-in controls.

applyHoverLabelConfig()

Source: src/behaviors/HoverBehavior.js:187

Updates the hover label config state on the current instance.

resolveHoverLabelValue(index, network = this.context?.network ?? null)

Source: src/behaviors/HoverBehavior.js:211

Configures or reads resolve hover label value.

Parameters

NameTypeAttributesDefaultDescription
indexnumberNode, edge, or attribute index.
networkHeliosNetworkoptionalthis.context?.network ?? nullNetwork instance to read from or mutate.

Rendering And Picking

Render requests, picking, framebuffer inspection, and attribute tracking. HoverBehavior and SelectionBehavior use these lower-level hooks.

syncPicking()

Source: src/behaviors/HoverBehavior.js:207

Configures or reads sync picking.

Configuration

General configuration setters and compatibility helpers.

clearNodeHover(options = {}) → {Object|this}

Source: src/behaviors/HoverBehavior.js:215

Read or set the clear node hover setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current clear node hover value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


helios.clearNodeHover({
  enabled: true,
});

clearEdgeHover(options = {}) → {Object|this}

Source: src/behaviors/HoverBehavior.js:223

Read or set the clear edge hover setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current clear edge hover value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


helios.clearEdgeHover({
  enabled: true,
});

Utilities

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

detach()

Source: src/behaviors/HoverBehavior.js:89

Manages detach for the current instance.

update(options = {}) → {Object|this}

Source: src/behaviors/HoverBehavior.js:102

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,
});

emitChange(reason, detail = {})

Source: src/behaviors/HoverBehavior.js:175

Configures or reads emit change.

Parameters

NameTypeAttributesDefaultDescription
reasonstringReason for this operation.
detailoptional{}Event payload passed to listeners.

applyHoverConnectedEdges()

Source: src/behaviors/HoverBehavior.js:191

Updates the hover connected edges state on the current instance.

applyHighlightConnectedEdges()

Source: src/behaviors/HoverBehavior.js:195

Updates the highlight connected edges state on the current instance.

applyHoverStylePolicy()

Source: src/behaviors/HoverBehavior.js:199

Updates the hover style policy state on the current instance.

handleNodeHover(event)

Source: src/behaviors/HoverBehavior.js:231

Configures or reads handle node hover.

Parameters

NameTypeAttributesDefaultDescription
eventValue passed to handleNodeHover.

handleEdgeHover(event)

Source: src/behaviors/HoverBehavior.js:244

Configures or reads handle edge hover.

Parameters

NameTypeAttributesDefaultDescription
eventValue passed to handleEdgeHover.

handleUiBindingChange(event)

Source: src/behaviors/HoverBehavior.js:277

Configures or reads handle ui binding change.

Parameters

NameTypeAttributesDefaultDescription
eventValue passed to handleUiBindingChange.

handleHighlightChange()

Source: src/behaviors/HoverBehavior.js:284

Configures or reads handle highlight change.