Skip to content

Selectors And Serialization

Selectors make graph queries explicit. They can be built from query strings, lists of ids, or neighborhood operations, and they are useful for analysis, filtering, exporting subsets, and handoff into visualization workflows.

Serialization preserves the graph and its attributes so data workflows can move between browser sessions, Node scripts, Python, native code, and Helios Web. For the complete format matrix and cross-language examples, see the data formats guide.

Select Nodes And Edges With Queries

This example writes a numeric score attribute with the chainable writer API, then selects nodes and edges with query expressions. Query expressions can refer to node attributes, edge attributes, and endpoint attributes.

Select Nodes And Edges With Queries

      

Round Trip A Network Snapshot

ZXNet is the compact Helios network format. This example saves a graph to a byte array, restores it, and then exports Node-Link JSON for interoperability.

Round Trip A Network Snapshot

      

Handoff Into Helios Web

The Network and Web packages meet at the Helios constructor. A Network example becomes visual when the graph object is passed to Helios Web.

import HeliosNetwork from "helios-network";
import { Helios } from "helios-web";

const network = await HeliosNetwork.fromZXNet(file);
const helios = new Helios(network, {
  container: document.querySelector('#app'),
  mode: '2d',
});
await helios.ready;

See Helios Web basic rendering for the rendered version of this workflow.