Skip to content

FilterBehavior

class

Back to Helios Web API

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

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:51

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:179

Returns the current public state value or state.

Example


const value = helios.getPublicState();

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

Source: src/behaviors/FilterBehavior.js:217

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.
scopeoptional{}Attribute scope: node, edge, or network.

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:234

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:255

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:60

Configures or reads attach.

Parameters

NameTypeAttributesDefaultDescription
contextValue passed to attach.

serialize()

Source: src/behaviors/FilterBehavior.js:92

Handles serialize for the current graph or visualization state.

restore(snapshot = {}) → {this}

Source: src/behaviors/FilterBehavior.js:161

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.

getModel()

Source: src/behaviors/FilterBehavior.js:187

Returns the current model value or state.

Example


const value = helios.getModel();

setScope(scope) → {this}

Source: src/behaviors/FilterBehavior.js:198

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:75

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:105

Configures or reads state entries.

emitChange(reason, detail = {})

Source: src/behaviors/FilterBehavior.js:175

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:191

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:275

Configures or reads sync from helios.

Parameters

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