Skip to content

VisualAttributes

class

Back to Helios Web API

Kind
class
Source
src/pipeline/VisualAttributes.js:168

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

Node positions exposed by the class.

nodeColors

Source: src/pipeline/VisualAttributes.js:187

Node colors exposed by the class.

nodeSizes

Source: src/pipeline/VisualAttributes.js:191

Node sizes exposed by the class.

nodeStates

Source: src/pipeline/VisualAttributes.js:195

Node states exposed by the class.

nodeOutlineWidths

Source: src/pipeline/VisualAttributes.js:199

Node outline widths exposed by the class.

nodeOutlineColors

Source: src/pipeline/VisualAttributes.js:203

Node outline colors exposed by the class.

edgeColors

Source: src/pipeline/VisualAttributes.js:207

Edge colors exposed by the class.

edgeWidths

Source: src/pipeline/VisualAttributes.js:211

Edge widths exposed by the class.

edgeOpacities

Source: src/pipeline/VisualAttributes.js:215

Edge opacities exposed by the class.

edgeStates

Source: src/pipeline/VisualAttributes.js:219

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

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

Configures or reads mark positions dirty.

seedMissingPositions(bounds = {})

Source: src/pipeline/VisualAttributes.js:847

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

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

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

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

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

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

Returns the current node attribute view value or state.

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

getEdgeAttributeView(name)

Source: src/pipeline/VisualAttributes.js:228

Returns the current edge attribute view value or state.

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

getPreparedNodeAttributeView(prepared, name)

Source: src/pipeline/VisualAttributes.js:279

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

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

Configures or reads normalize lookup name.

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute or API identifier.

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

Source: src/pipeline/VisualAttributes.js:237

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

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

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

Configures or reads build node constant config.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to buildNodeConstantConfig.

buildEdgeConstantConfig(mapper, nodeConfig = null)

Source: src/pipeline/VisualAttributes.js:381

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

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

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

Configures or reads ensure attributes.

bumpNodeAttributes(...names)

Source: src/pipeline/VisualAttributes.js:691

Configures or reads bump node attributes.

bumpEdgeAttributes(...names)

Source: src/pipeline/VisualAttributes.js:717

Configures or reads bump edge attributes.

applyNodeDefaults(indices)

Source: src/pipeline/VisualAttributes.js:750

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

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

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

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

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

Configures or reads collect attribute names.

Parameters

NameTypeAttributesDefaultDescription
mapperValue passed to collectAttributeNames.
modestringMode for this operation.

resolveNodeAttributeBuffers(names)

Source: src/pipeline/VisualAttributes.js:1161

Configures or reads resolve node attribute buffers.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to resolveNodeAttributeBuffers.

resolveEdgeAttributeBuffers(names)

Source: src/pipeline/VisualAttributes.js:1181

Configures or reads resolve edge attribute buffers.

Parameters

NameTypeAttributesDefaultDescription
namesValue passed to resolveEdgeAttributeBuffers.

buildAttributeObject(buffers, index)

Source: src/pipeline/VisualAttributes.js:1200

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

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

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

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

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

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

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

Configures or reads with buffer access.

Parameters

NameTypeAttributesDefaultDescription
fnValue passed to withBufferAccess.

flushPendingAttributeBumps()

Source: src/pipeline/VisualAttributes.js:1503

Configures or reads flush pending attribute bumps.