Skip to content

networkAttribute

method

Back to Helios Network JS/WASM API

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

Description

Defines or updates one network-level attribute and returns the network for chaining. Network attributes store one graph-wide value at id/ordinal 0. Missing attributes are defined from options.type / options.dimension, or inferred from the provided value or callback result.

Signature

networkAttribute(name, valueOrFn, options = {}) {

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute identifier.
valueOrFn*|function(*, number, number, HeliosNetwork): *Scalar, vector, or callback.
optionsAttributeWriteOptionsoptionalOptional type and dimension controls.

Returns

This network.

Type HeliosNetwork

Notes

Network attributes store graph-wide metadata such as titles, coordinate bounds, import provenance, or visualization defaults. They have one logical value and do not iterate over nodes or edges.

Example

net
  .networkAttribute('title', 'Example graph')
  .networkAttribute('bounds', [0, 1], { type: 'float', dimension: 2 });