Skip to content

getEdgeAttributeBuffer

method

Back to Helios Network JS/WASM API

Kind
method
Source
src/js/HeliosNetwork.js:6143

Description

Retrieves a wrapper around the edge attribute buffer.

Signature

getEdgeAttributeBuffer(name) {

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute identifier.

Returns

Wrapper providing type information and buffer helpers.

Type Object

Example

const net = await HeliosNetwork.create();
net.addNodes(2);
net.defineEdgeAttribute('capacity', AttributeType.Double);
const edges = net.addEdges([[0, 1]]);
net.withBufferAccess(() => {
  const attribute = net.getEdgeAttributeBuffer('capacity');
  attribute.view[edges[0]] = 12.5;
});