Skip to content

Graphs And Attributes

Helios Network is a WebAssembly-backed graph store. The graph topology lives in the WASM core, while the JavaScript wrapper provides ergonomic methods for building graphs, attaching attributes, querying data, and serializing snapshots.

The examples on this page use the chainable attribute writer API. These helpers are the recommended default for application code because they define missing attributes, infer practical schemas, write values, and bump versions in one place.

Create A WASM-Backed Graph

This first data example creates a directed graph, adds nodes and edges, and logs the allocated ids. Node and edge ids are stable integer identifiers; they are not necessarily the same thing as ordinal position in an active subset.

Create A WASM-Backed Graph

      

Write Attributes With Chainable Helpers

The chainable writers accept scalars, arrays, typed arrays, callbacks, and multi-attribute records. By default, array-like values are indexed by active ordinal, which is the right behavior for most imported row data. Pass { indexBy: 'id' } when your data array is keyed by graph id.

Use Chainable Attributes

      

Write Multiple Attributes Together

Use nodeAttributes(...) and edgeAttributes(...) when several attributes come from the same row. The callback receives the current value record, entity id, active ordinal, and the network instance. It can return an array aligned with the requested names or an object keyed by attribute name.

Write Multiple Attributes

      

When writing a graph for visualization, these attributes can be used directly by Helios Web mappers, filters, labels, and selectors.