Skip to content

FilterBehavior

class

Back to Helios Web API

Kind
class
Source
src/behaviors/FilterBehavior.js:56

Description

Built-in behavior for graph filtering.

Signature

export class FilterBehavior extends Behavior {

Parameters

NameTypeAttributesDefaultDescription
optionsObject|HeliosFilteroptionalFilter model or rule options for numeric, categorical, string, and query rules.

Returns

Behavior that applies render-only or render-plus-layout filtered graph views.

Type FilterBehavior

Notes

scope: "render" keeps the layout topology intact; scope: "render+layout" rebuilds the active graph view used by both rendering and dynamic layouts.

Instance Properties

id

Source: src/behaviors/FilterBehavior.js:57

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/FilterBehavior.js:205

Returns the current public state value or state.

Example


const value = helios.getPublicState();

replaceRules({ nodeRules = [], edgeRules = [], scope, minComponentSize } = {}) → {FilterBehavior}

Source: src/behaviors/FilterBehavior.js:248

Replace all active node and edge filter rules.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptionalReplacement filter options.
nodeRulesArray.<Object>optionalNode rules to apply.
edgeRulesArray.<Object>optionalEdge rules to apply.
scope'render'|'render+layout'optionalFilter scope.
nodeRulesoptional[]Value passed to replaceRules.
edgeRulesoptional[]Value passed to replaceRules.
scopeAttribute scope: node, edge, or network.
minComponentSizeoptional{}Value passed to replaceRules.

Returns

This behavior instance.

Type FilterBehavior

Notes

render+layout changes the graph view consumed by dynamic layouts. Use render when hiding items should not change layout forces.

clear() → {FilterBehavior}

Source: src/behaviors/FilterBehavior.js:268

Remove the active graph filter and restore the unfiltered render view.

Returns

This behavior instance.

Type FilterBehavior

setFilterModel(model, { reason = 'model', trackOverride = true } = {}) → {this}

Source: src/behaviors/FilterBehavior.js:290

Set the filter model setting.

Parameters

NameTypeAttributesDefaultDescription
modelValue passed to setFilterModel.
reasonstringoptional'model'Reason for this operation.
trackOverrideoptionaltrue } = {}Value passed to setFilterModel.

Returns

This instance.

Type this

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/FilterBehavior.js:67

Configures or reads attach.

Parameters

NameTypeAttributesDefaultDescription
contextValue passed to attach.

serialize()

Source: src/behaviors/FilterBehavior.js:102

Handles serialize for the current graph or visualization state.

restore(snapshot = {}) → {this}

Source: src/behaviors/FilterBehavior.js:186

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.

setMinComponentSize(value) → {number|this}

Source: src/behaviors/FilterBehavior.js:230

Read or set the set min component size setting.

Parameters

NameTypeAttributesDefaultDescription
valuenumberNew set min component size value. Omit this argument to read the current value.

Returns

Current set min component size value when called without arguments; otherwise this instance for chaining.

Type number|this

Example


helios.setMinComponentSize(1);

Configuration

General configuration setters and compatibility helpers.

getModel()

Source: src/behaviors/FilterBehavior.js:213

Returns the current model value or state.

Example


const value = helios.getModel();

setScope(scope) → {this}

Source: src/behaviors/FilterBehavior.js:224

Set the scope setting.

Parameters

NameTypeAttributesDefaultDescription
scopeAttribute scope: node, edge, or network.

Returns

This instance.

Type this

Utilities

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

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

Source: src/behaviors/FilterBehavior.js:82

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/FilterBehavior.js:116

Configures or reads state entries.

emitChange(reason, detail = {})

Source: src/behaviors/FilterBehavior.js:201

Configures or reads emit change.

Parameters

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

filters(options) → {Object|this}

Source: src/behaviors/FilterBehavior.js:217

Read or set the filters setting.

Parameters

NameTypeAttributesDefaultDescription
optionsObjectOptions object for this operation.

Returns

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

Type Object|this

Example


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

syncFromHelios({ preferActiveModel = false, silent = false } = {})

Source: src/behaviors/FilterBehavior.js:314

Configures or reads sync from helios.

Parameters

NameTypeAttributesDefaultDescription
preferActiveModeloptionalfalseValue passed to syncFromHelios.
silentoptionalfalse } = {}Value passed to syncFromHelios.