Skip to content

VisualAttributes

class

Back to Helios Web API

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

export class VisualAttributes {

Parameters

NameTypeAttributesDefaultDescription
networkHeliosNetwork
debugValue 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

NameTypeAttributesDefaultDescription
configValue passed to setNetworkVisualConfig.

Returns

This instance.

Type this

Layout 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

NameTypeAttributesDefaultDescription
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

NameTypeAttributesDefaultDescription
nodeMapperValue passed to applyMappers.
edgeMapperoptional{}Value passed to applyMappers.

applyNodeMapper(mapper, visualConfig)

Source: src/pipeline/VisualAttributes.js:504

Updates the node mapper state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to applyNodeMapper.
visualConfigValue passed to applyNodeMapper.

applyEdgeMapper(mapper, visualConfig)

Source: src/pipeline/VisualAttributes.js:562

Updates the edge mapper state on the current instance.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to applyEdgeMapper.
visualConfigValue 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

NameTypeAttributesDefaultDescription
valueNew 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.

Type Object|this

Example


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

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

getEdgeAttributeView(name)

Source: src/pipeline/VisualAttributes.js:226

Returns the current edge attribute view value or state.

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

getPreparedNodeAttributeView(prepared, name)

Source: src/pipeline/VisualAttributes.js:277

Returns the current prepared node attribute view value or state.

Parameters

NameTypeAttributesDefaultDescription
preparedValue passed to getPreparedNodeAttributeView.
namestringAttribute or API identifier.

getPreparedEdgeAttributeView(prepared, name)

Source: src/pipeline/VisualAttributes.js:286

Returns the current prepared edge attribute view value or state.

Parameters

NameTypeAttributesDefaultDescription
preparedValue passed to getPreparedEdgeAttributeView.
namestringAttribute 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

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

prepareNodeAttributeLookups(names, { allowMissing = false } = {})

Source: src/pipeline/VisualAttributes.js:235

Configures or reads prepare node attribute lookups.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to prepareNodeAttributeLookups.
allowMissingoptionalfalse } = {}Value passed to prepareNodeAttributeLookups.

prepareEdgeAttributeLookups(names, { allowMissing = false } = {})

Source: src/pipeline/VisualAttributes.js:256

Configures or reads prepare edge attribute lookups.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to prepareEdgeAttributeLookups.
allowMissingoptionalfalse } = {}Value passed to prepareEdgeAttributeLookups.

buildVisualConstantConfig({ nodeMapper, edgeMapper } = {})

Source: src/pipeline/VisualAttributes.js:350

Configures or reads build visual constant config.

Parameters

NameTypeAttributesDefaultDescription
nodeMapperValue passed to buildVisualConstantConfig.
edgeMapperoptional{}Value passed to buildVisualConstantConfig.

buildNodeConstantConfig(mapper)

Source: src/pipeline/VisualAttributes.js:358

Configures or reads build node constant config.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to buildNodeConstantConfig.

buildEdgeConstantConfig(mapper, nodeConfig = null)

Source: src/pipeline/VisualAttributes.js:379

Configures or reads build edge constant config.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to buildEdgeConstantConfig.
nodeConfigoptionalnullValue passed to buildEdgeConstantConfig.

augmentEdgeSourceConfig(edgeConfig, mapper)

Source: src/pipeline/VisualAttributes.js:422

Configures or reads augment edge source config.

Parameters

NameTypeAttributesDefaultDescription
edgeConfigValue passed to augmentEdgeSourceConfig.
mapperValue passed to augmentEdgeSourceConfig.

ensureVisualAttributesForConfig({ nodeMapper, edgeMapper, visualConfig } = {})

Source: src/pipeline/VisualAttributes.js:634

Configures or reads ensure visual attributes for config.

Parameters

NameTypeAttributesDefaultDescription
nodeMapperValue passed to ensureVisualAttributesForConfig.
edgeMapperValue passed to ensureVisualAttributesForConfig.
visualConfigoptional{}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

NameTypeAttributesDefaultDescription
indicesIterable<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

NameTypeAttributesDefaultDescription
indicesIterable<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

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.
typestringAttribute value type.
dimensionElement width or memory-stride setting.

ensureEdgeAttribute(name, type, dimension)

Source: src/pipeline/VisualAttributes.js:1013

Configures or reads ensure edge attribute.

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.
typestringAttribute value type.
dimensionElement width or memory-stride setting.

ensureNodeToEdgeAttribute(sourceName, edgeName, sourceDimension)

Source: src/pipeline/VisualAttributes.js:1075

Configures or reads ensure node to edge attribute.

Parameters

NameTypeAttributesDefaultDescription
sourceNameAttribute or API identifier.
edgeNameAttribute or API identifier.
sourceDimensionValue passed to ensureNodeToEdgeAttribute.

collectAttributeNames(mapper, mode)

Source: src/pipeline/VisualAttributes.js:1133

Configures or reads collect attribute names.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to collectAttributeNames.
modestringMode for this operation.

resolveNodeAttributeBuffers(names)

Source: src/pipeline/VisualAttributes.js:1159

Configures or reads resolve node attribute buffers.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to resolveNodeAttributeBuffers.

resolveEdgeAttributeBuffers(names)

Source: src/pipeline/VisualAttributes.js:1179

Configures or reads resolve edge attribute buffers.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to resolveEdgeAttributeBuffers.

buildAttributeObject(buffers, index)

Source: src/pipeline/VisualAttributes.js:1198

Configures or reads build attribute object.

Parameters

NameTypeAttributesDefaultDescription
buffersValue passed to buildAttributeObject.
indexnumberNode, edge, or attribute index.

buildEdgeAttributeObject(buffers, edgeId)

Source: src/pipeline/VisualAttributes.js:1218

Configures or reads build edge attribute object.

Parameters

NameTypeAttributesDefaultDescription
buffersValue passed to buildEdgeAttributeObject.
edgeIdValue passed to buildEdgeAttributeObject.

writeNodeVisuals(nodeId, mapped, visuals)

Source: src/pipeline/VisualAttributes.js:1222

Configures or reads write node visuals.

Parameters

NameTypeAttributesDefaultDescription
nodeIdNode or edge identifiers/indices used by the operation.
mappedValue passed to writeNodeVisuals.
visualsValue passed to writeNodeVisuals.

writeEdgeVisuals(edgeId, mapped, visuals)

Source: src/pipeline/VisualAttributes.js:1255

Configures or reads write edge visuals.

Parameters

NameTypeAttributesDefaultDescription
edgeIdValue passed to writeEdgeVisuals.
mappedValue passed to writeEdgeVisuals.
visualsValue passed to writeEdgeVisuals.

toRgba(value) → {Object|this}

Source: src/pipeline/VisualAttributes.js:1291

Read or set the to rgba setting.

Parameters

NameTypeAttributesDefaultDescription
valueNew 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.

Type Object|this

Example


helios.toRgba(1);

resolveEdgeScalarPair(value) → {boolean|this}

Source: src/pipeline/VisualAttributes.js:1380

Read or set the resolve edge scalar pair setting.

Parameters

NameTypeAttributesDefaultDescription
valuebooleanNew 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.

Type boolean|this

Example


helios.resolveEdgeScalarPair(true);

writeEdgeDefaults(index, color, width, opacity, colorView, widthView, opacityView)

Source: src/pipeline/VisualAttributes.js:1454

Configures or reads write edge defaults.

Parameters

NameTypeAttributesDefaultDescription
indexnumberNode, edge, or attribute index.
colorstring|Array<number>New write edge defaults value. Omit this argument to read the current value.
widthValue passed to writeEdgeDefaults.
opacityValue passed to writeEdgeDefaults.
colorViewValue passed to writeEdgeDefaults.
widthViewValue passed to writeEdgeDefaults.
opacityViewValue passed to writeEdgeDefaults.

withBufferAccess(fn)

Source: src/pipeline/VisualAttributes.js:1481

Configures or reads with buffer access.

Parameters

NameTypeAttributesDefaultDescription
fnValue passed to withBufferAccess.

flushPendingAttributeBumps()

Source: src/pipeline/VisualAttributes.js:1501

Configures or reads flush pending attribute bumps.