VisualAttributes
- Kind
- class
- Source
- src/pipeline/VisualAttributes.js:166
Description
Ensures required visual attributes exist on the Helios network, seeds defaults, and provides helpers to apply mappers into sparse buffers.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
network | HeliosNetwork | |||
debug | Value passed to constructor. |
Instance Properties
nodePositions
Source: src/pipeline/VisualAttributes.js:181
Node positions exposed by the class.
nodeColors
Source: src/pipeline/VisualAttributes.js:185
Node colors exposed by the class.
nodeSizes
Source: src/pipeline/VisualAttributes.js:189
Node sizes exposed by the class.
nodeStates
Source: src/pipeline/VisualAttributes.js:193
Node states exposed by the class.
nodeOutlineWidths
Source: src/pipeline/VisualAttributes.js:197
Node outline widths exposed by the class.
nodeOutlineColors
Source: src/pipeline/VisualAttributes.js:201
Node outline colors exposed by the class.
edgeColors
Source: src/pipeline/VisualAttributes.js:205
Edge colors exposed by the class.
edgeWidths
Source: src/pipeline/VisualAttributes.js:209
Edge widths exposed by the class.
edgeOpacities
Source: src/pipeline/VisualAttributes.js:213
Edge opacities exposed by the class.
edgeStates
Source: src/pipeline/VisualAttributes.js:217
Edge states exposed by the class.
Network And Persistence
Network replacement, serialization, and visualization state persistence. ExporterBehavior and InterfaceBehavior can surface parts of this flow in the UI.
setNetworkVisualConfig(config) → {this}
Source: src/pipeline/VisualAttributes.js:341
Set the network visual config setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
config | Value passed to setNetworkVisualConfig. |
Returns
This instance.
TypethisLayout And Positions
Layout selection, position sources, interpolation, and position snapshots. LayoutBehavior handles the built-in layout UI.
markPositionsDirty()
Source: src/pipeline/VisualAttributes.js:740
Configures or reads mark positions dirty.
seedMissingPositions(bounds = {})
Source: src/pipeline/VisualAttributes.js:845
Seeds missing node positions with random values so downstream layouts/renderers always have finite coordinates to start with.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
bounds | {width?: number, height?: number, depth?: number, mode?: string, center?: number[]} | optional |
Mappers
Mapper configuration for node and edge visual channels. MappersBehavior handles mapper UI state.
applyMappers({ nodeMapper, edgeMapper } = {})
Source: src/pipeline/VisualAttributes.js:327
Updates the mappers state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
nodeMapper | Value passed to applyMappers. | |||
edgeMapper | optional | {} | Value passed to applyMappers. |
applyNodeMapper(mapper, visualConfig)
Source: src/pipeline/VisualAttributes.js:504
Updates the node mapper state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mapper | Value passed to applyNodeMapper. | |||
visualConfig | Value passed to applyNodeMapper. |
applyEdgeMapper(mapper, visualConfig)
Source: src/pipeline/VisualAttributes.js:562
Updates the edge mapper state on the current instance.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mapper | Value passed to applyEdgeMapper. | |||
visualConfig | Value passed to applyEdgeMapper. |
Appearance
Visual rendering settings for nodes, edges, labels, legends, density, shading, and background. AppearanceBehavior, LabelsBehavior, and LegendsBehavior cover the built-in controls.
seedMissingEdgeOpacity()
Source: src/pipeline/VisualAttributes.js:300
When networks are populated before Helios is created, edge opacity buffers start at zero which hides edges entirely. Seed a reasonable default for any active edge that still has an uninitialized (zero/invalid) opacity.
resolveEdgeColorPair(value) → {Object|this}
Source: src/pipeline/VisualAttributes.js:1359
Read or set the resolve edge color pair setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New resolve edge color pair value. Omit this argument to read the current value. |
Returns
Current resolve edge color pair value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.resolveEdgeColorPair(1);
Configuration
General configuration setters and compatibility helpers.
getNodeAttributeView(name)
Source: src/pipeline/VisualAttributes.js:221
Returns the current node attribute view value or state.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute or API identifier. |
getEdgeAttributeView(name)
Source: src/pipeline/VisualAttributes.js:226
Returns the current edge attribute view value or state.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute or API identifier. |
getPreparedNodeAttributeView(prepared, name)
Source: src/pipeline/VisualAttributes.js:277
Returns the current prepared node attribute view value or state.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
prepared | Value passed to getPreparedNodeAttributeView. | |||
name | string | Attribute or API identifier. |
getPreparedEdgeAttributeView(prepared, name)
Source: src/pipeline/VisualAttributes.js:286
Returns the current prepared edge attribute view value or state.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
prepared | Value passed to getPreparedEdgeAttributeView. | |||
name | string | Attribute or API identifier. |
Utilities
Additional public helpers that do not belong to a narrower API area.
normalizeLookupName(name)
Source: src/pipeline/VisualAttributes.js:231
Configures or reads normalize lookup name.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute or API identifier. |
prepareNodeAttributeLookups(names, { allowMissing = false } = {})
Source: src/pipeline/VisualAttributes.js:235
Configures or reads prepare node attribute lookups.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
names | Value passed to prepareNodeAttributeLookups. | |||
allowMissing | optional | false } = {} | Value passed to prepareNodeAttributeLookups. |
prepareEdgeAttributeLookups(names, { allowMissing = false } = {})
Source: src/pipeline/VisualAttributes.js:256
Configures or reads prepare edge attribute lookups.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
names | Value passed to prepareEdgeAttributeLookups. | |||
allowMissing | optional | false } = {} | Value passed to prepareEdgeAttributeLookups. |
buildVisualConstantConfig({ nodeMapper, edgeMapper } = {})
Source: src/pipeline/VisualAttributes.js:350
Configures or reads build visual constant config.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
nodeMapper | Value passed to buildVisualConstantConfig. | |||
edgeMapper | optional | {} | Value passed to buildVisualConstantConfig. |
buildNodeConstantConfig(mapper)
Source: src/pipeline/VisualAttributes.js:358
Configures or reads build node constant config.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mapper | Value passed to buildNodeConstantConfig. |
buildEdgeConstantConfig(mapper, nodeConfig = null)
Source: src/pipeline/VisualAttributes.js:379
Configures or reads build edge constant config.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mapper | Value passed to buildEdgeConstantConfig. | |||
nodeConfig | optional | null | Value passed to buildEdgeConstantConfig. |
augmentEdgeSourceConfig(edgeConfig, mapper)
Source: src/pipeline/VisualAttributes.js:422
Configures or reads augment edge source config.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
edgeConfig | Value passed to augmentEdgeSourceConfig. | |||
mapper | Value passed to augmentEdgeSourceConfig. |
ensureVisualAttributesForConfig({ nodeMapper, edgeMapper, visualConfig } = {})
Source: src/pipeline/VisualAttributes.js:634
Configures or reads ensure visual attributes for config.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
nodeMapper | Value passed to ensureVisualAttributesForConfig. | |||
edgeMapper | Value passed to ensureVisualAttributesForConfig. | |||
visualConfig | optional | {} | Value passed to ensureVisualAttributesForConfig. |
ensureAttributes()
Source: src/pipeline/VisualAttributes.js:683
Configures or reads ensure attributes.
bumpNodeAttributes(...names)
Source: src/pipeline/VisualAttributes.js:689
Configures or reads bump node attributes.
bumpEdgeAttributes(...names)
Source: src/pipeline/VisualAttributes.js:715
Configures or reads bump edge attributes.
applyNodeDefaults(indices)
Source: src/pipeline/VisualAttributes.js:748
Initializes basic node visuals. Can be re-used whenever nodes are added.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
indices | Iterable<number> | optional |
Example
helios.applyNodeDefaults([0, 1, 2]);
applyEdgeDefaults(indices)
Source: src/pipeline/VisualAttributes.js:805
Initializes basic edge visuals. Can be re-used whenever edges are added.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
indices | Iterable<number> | optional |
Example
helios.applyEdgeDefaults([0, 1, 2]);
ensureNodeAttribute(name, type, dimension)
Source: src/pipeline/VisualAttributes.js:951
Configures or reads ensure node attribute.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute or API identifier. | ||
type | string | Attribute value type. | ||
dimension | Element width or memory-stride setting. |
ensureEdgeAttribute(name, type, dimension)
Source: src/pipeline/VisualAttributes.js:1013
Configures or reads ensure edge attribute.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute or API identifier. | ||
type | string | Attribute value type. | ||
dimension | Element width or memory-stride setting. |
ensureNodeToEdgeAttribute(sourceName, edgeName, sourceDimension)
Source: src/pipeline/VisualAttributes.js:1075
Configures or reads ensure node to edge attribute.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
sourceName | Attribute or API identifier. | |||
edgeName | Attribute or API identifier. | |||
sourceDimension | Value passed to ensureNodeToEdgeAttribute. |
collectAttributeNames(mapper, mode)
Source: src/pipeline/VisualAttributes.js:1133
Configures or reads collect attribute names.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
mapper | Value passed to collectAttributeNames. | |||
mode | string | Mode for this operation. |
resolveNodeAttributeBuffers(names)
Source: src/pipeline/VisualAttributes.js:1159
Configures or reads resolve node attribute buffers.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
names | Value passed to resolveNodeAttributeBuffers. |
resolveEdgeAttributeBuffers(names)
Source: src/pipeline/VisualAttributes.js:1179
Configures or reads resolve edge attribute buffers.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
names | Value passed to resolveEdgeAttributeBuffers. |
buildAttributeObject(buffers, index)
Source: src/pipeline/VisualAttributes.js:1198
Configures or reads build attribute object.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
buffers | Value passed to buildAttributeObject. | |||
index | number | Node, edge, or attribute index. |
buildEdgeAttributeObject(buffers, edgeId)
Source: src/pipeline/VisualAttributes.js:1218
Configures or reads build edge attribute object.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
buffers | Value passed to buildEdgeAttributeObject. | |||
edgeId | Value passed to buildEdgeAttributeObject. |
writeNodeVisuals(nodeId, mapped, visuals)
Source: src/pipeline/VisualAttributes.js:1222
Configures or reads write node visuals.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
nodeId | Node or edge identifiers/indices used by the operation. | |||
mapped | Value passed to writeNodeVisuals. | |||
visuals | Value passed to writeNodeVisuals. |
writeEdgeVisuals(edgeId, mapped, visuals)
Source: src/pipeline/VisualAttributes.js:1255
Configures or reads write edge visuals.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
edgeId | Value passed to writeEdgeVisuals. | |||
mapped | Value passed to writeEdgeVisuals. | |||
visuals | Value passed to writeEdgeVisuals. |
toRgba(value) → {Object|this}
Source: src/pipeline/VisualAttributes.js:1291
Read or set the to rgba setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | New to rgba value. Omit this argument to read the current value. |
Returns
Current to rgba value when called without arguments; otherwise this instance for chaining.
TypeObject|thisExample
helios.toRgba(1);
resolveEdgeScalarPair(value) → {boolean|this}
Source: src/pipeline/VisualAttributes.js:1380
Read or set the resolve edge scalar pair setting.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | boolean | New resolve edge scalar pair value. Omit this argument to read the current value. |
Returns
Current resolve edge scalar pair value when called without arguments; otherwise this instance for chaining.
Typeboolean|thisExample
helios.resolveEdgeScalarPair(true);
writeEdgeDefaults(index, color, width, opacity, colorView, widthView, opacityView)
Source: src/pipeline/VisualAttributes.js:1454
Configures or reads write edge defaults.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index | number | Node, edge, or attribute index. | ||
color | string|Array<number> | New write edge defaults value. Omit this argument to read the current value. | ||
width | Value passed to writeEdgeDefaults. | |||
opacity | Value passed to writeEdgeDefaults. | |||
colorView | Value passed to writeEdgeDefaults. | |||
widthView | Value passed to writeEdgeDefaults. | |||
opacityView | Value passed to writeEdgeDefaults. |
withBufferAccess(fn)
Source: src/pipeline/VisualAttributes.js:1481
Configures or reads with buffer access.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
fn | Value passed to withBufferAccess. |
flushPendingAttributeBumps()
Source: src/pipeline/VisualAttributes.js:1501
Configures or reads flush pending attribute bumps.