nodeAttribute
method
Back to Helios Network JS/WASM API
- Kind
- method
- Source
- src/js/HeliosNetwork.js:5556
Description
Defines or updates one node attribute and returns the network for chaining. Missing attributes are defined from options.type / options.dimension, or inferred from the provided scalar, array-like value, or callback result. Array-like values are indexed by active ordinal by default; pass { indexBy: 'id' } to index them by node id instead.
Signature
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Attribute identifier. | ||
valueOrFn | *|function(*, number, number, HeliosNetwork): * | Scalar, array-like values, or callback. | ||
options | AttributeWriteOptions | optional | Optional type, dimension, and indexing controls. |
Returns
This network.
TypeHeliosNetworkNotes
This is the recommended API for normal application code. It performs
any needed allocation before writing values, so callers do not need to manage
WASM typed-array view lifetime directly. Use withBufferAccess(...) only when
you intentionally want the lower-level fast path for very large writes.