FilterBehavior
- Kind
- class
- Source
- src/behaviors/FilterBehavior.js:50
Description
Built-in behavior for graph filtering.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object|HeliosFilter | optional | Filter model or rule options for numeric, categorical, string, and query rules. |
Returns
Behavior that applies render-only or render-plus-layout filtered graph views.
TypeFilterBehaviorNotes
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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | Replacement filter options. | |
nodeRules | Array.<Object> | optional | Node rules to apply. | |
edgeRules | Array.<Object> | optional | Edge rules to apply. | |
scope | 'render'|'render+layout' | optional | Filter scope. | |
nodeRules | optional | [] | Value passed to replaceRules. | |
edgeRules | optional | [] | Value passed to replaceRules. | |
scope | optional | {} | Attribute scope: node, edge, or network. |
Returns
This behavior instance.
TypeFilterBehaviorNotes
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.
TypeFilterBehaviorsetFilterModel(model, { reason = 'model', trackOverride = true } = {}) → {this}
Source: src/behaviors/FilterBehavior.js:255
Set the filter model setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
model | Value passed to setFilterModel. | |||
reason | string | optional | 'model' | Reason for this operation. |
trackOverride | optional | true } = {} | Value passed to setFilterModel. |
Returns
This instance.
TypethisNetwork 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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
context | Value 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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
snapshot | optional | {} | Value passed to restore. |
Returns
This instance.
TypethisConfiguration
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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
scope | Attribute scope: node, edge, or network. |
Returns
This instance.
TypethisUtilities
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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | optional | {} | Options object for this operation. |
Returns
Current update value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
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
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
reason | string | Reason for this operation. | ||
detail | optional | {} | Event payload passed to listeners. |
filters(options) → {Object|this}
Source: src/behaviors/FilterBehavior.js:191
Read or set the filters setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options | Object | Options object for this operation. |
Returns
Current filters value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.filters({
enabled: true,
});
syncFromHelios({ preferActiveModel = false, silent = false } = {})
Source: src/behaviors/FilterBehavior.js:275
Configures or reads sync from helios.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
preferActiveModel | optional | false | Value passed to syncFromHelios. | |
silent | optional | false } = {} | Value passed to syncFromHelios. |