Skip to content

Methods

Back to Helios Network JS/WASM API

High-level chainable attribute helpers and low-level buffer access methods.

The JavaScript/WASM methods are split between ergonomic helpers and low-level buffer access. Attribute helpers are the right default for application code. Direct buffer methods are for performance-sensitive integrations that need to operate on WASM-backed typed arrays.

When using direct buffers, allocate first and view second. Avoid holding a typed array view across calls that can grow WASM memory; use withBufferAccess(...) where available.

method defineEdgeAttribute Defines an edge attribute backed by linear WASM memory. method defineNetworkAttribute Defines a network-level attribute backed by linear WASM memory. method defineNodeAttribute Defines a node attribute backed by linear WASM memory. method edgeAttribute Defines or updates one edge attribute and returns the network for chaining. method edgeAttributes Defines or updates several edge attributes and returns the network for chaining. method getEdgeAttributeBuffer Retrieves a wrapper around the edge attribute buffer. method getNetworkAttributeBuffer Retrieves a wrapper around the network attribute buffer. method getNodeAttributeBuffer Retrieves a wrapper around the node attribute buffer. method networkAttribute 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. method networkAttributes 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. method nodeAttribute 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. method nodeAttributes Defines or updates several node attributes and returns the network for chaining. `valuesOrFn` may be an object keyed by attribute name, an array of per-attribute scalar values, or a callback returning either an array aligned with `names` or an object keyed by attribute name. method withBufferAccess Runs a callback inside a buffer access session, ensuring cleanup even on throw.