Skip to content

LegendsBehavior

class

Back to Helios Web API

Kind
class
Source
src/behaviors/LegendsBehavior.js:109

Description

Built-in behavior for legend overlays.

Signature

export class LegendsBehavior extends Behavior {

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptionalLegend visibility, placement, typography, scale, title, and export compatibility options.

Returns

Behavior controlling SVG legends for mapper and density channels.

Type LegendsBehavior

Notes

Legends read mapper and density configuration from the live Helios instance and preserve serializable placement, title, and visibility state.

Instance Properties

id

Source: src/behaviors/LegendsBehavior.js:110

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/LegendsBehavior.js:269

Returns the current public state value or state.

Example


const value = helios.getPublicState();

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/LegendsBehavior.js:122

Configures or reads attach.

Parameters

NameTypeAttributesDefaultDescription
contextValue passed to attach.

serialize()

Source: src/behaviors/LegendsBehavior.js:166

Handles serialize for the current graph or visualization state.

restore(snapshot = {}) → {this}

Source: src/behaviors/LegendsBehavior.js:262

Updates the restore state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
snapshotoptional{}Value passed to restore.

Returns

This instance.

Type this

Appearance

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

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

Source: src/behaviors/LegendsBehavior.js:298

Read or set the get legend items setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.

Returns

Current get legend items value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


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

Utilities

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

update(options = {}, changeOptions = {})

Source: src/behaviors/LegendsBehavior.js:144

Configures or reads update.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptional{}Options object for this operation.
changeOptionsoptional{}Value passed to update.

Example


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

stateEntries()

Source: src/behaviors/LegendsBehavior.js:172

Configures or reads state entries.

emitChange(reason, detail = {})

Source: src/behaviors/LegendsBehavior.js:273

Configures or reads emit change.

Parameters

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

legends(options) → {Object|this}

Source: src/behaviors/LegendsBehavior.js:277

Read or set the legends setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectOptions object for this operation.

Returns

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

Type Object|this

Example


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

enabled(value) → {boolean|this}

Source: src/behaviors/LegendsBehavior.js:283

Read or set the enabled setting.

Parameters

NameTypeAttributesDefaultDescription
valuebooleanNew enabled value. Omit this argument to read the current value.

Returns

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

Type boolean|this

Example


helios.enabled(true);

titles(value) → {Object|this}

Source: src/behaviors/LegendsBehavior.js:288

Read or set the titles setting.

Parameters

NameTypeAttributesDefaultDescription
valueNew titles value. Omit this argument to read the current value.

Returns

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

Type Object|this

Example


helios.titles(1);

placements(value) → {Object|this}

Source: src/behaviors/LegendsBehavior.js:293

Read or set the placements setting.

Parameters

NameTypeAttributesDefaultDescription
valueNew placements value. Omit this argument to read the current value.

Returns

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

Type Object|this

Example


helios.placements(1);

applyConfig({ silent = false } = {})

Source: src/behaviors/LegendsBehavior.js:312

Updates the config state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
silentoptionalfalse } = {}Value passed to applyConfig.