Skip to content

networkAttributes

method

Back to Helios Network JS/WASM API

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

Description

Defines or updates several network-level attributes and returns the network for chaining. valuesOrFn may be an object keyed by attribute name, an array aligned with names, or a callback returning either an array aligned with names or an object keyed by attribute name.

Signature

networkAttributes(names, valuesOrFn, options = {}) {

Parameters

NameTypeAttributesDefaultDescription
namesstring[]Attribute identifiers.
valuesOrFnObject|Array|function(Object, number, number, HeliosNetwork): (Array|Object)Sources for each attribute.
optionsAttributeWriteOptionsoptionalOptional type and dimension controls.

Returns

This network.

Type HeliosNetwork

Notes

Use this for compact graph-wide metadata updates, for example when loading a saved dataset and setting title, source, units, and bounds together.

Example

net.networkAttributes(['title', 'version'], { title: 'Example', version: 1 });