npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vizij/node-graph-wasm

v0.6.1

Published

WASM bindings for Vizij node-graph core.

Readme

@vizij/node-graph-wasm

Vizij's node graph engine for JavaScript.

This package ships the WebAssembly build of vizij-graph-core together with a TypeScript wrapper, schema helpers, node registry metadata, and fixture bundles.

Overview

  • Browser and Node compatible ESM package.
  • Main runtime wrapper: Graph.
  • Schema helpers: normalizeGraphSpec, getNodeSchemas, getNodeRegistry, findNodeSignature, requireNodeSignature, listNodeTypeIds, groupNodeSignaturesByCategory, logNodeSchemaDocs.
  • Fixture helpers: listNodeGraphFixtures, loadNodeGraphBundle, loadNodeGraphSpec, loadNodeGraphSpecJson, loadNodeGraphStage.
  • Sample exports via graphSamples.

Installation

npm install @vizij/node-graph-wasm

For local workspace development:

pnpm run build:wasm:graph
pnpm --filter @vizij/node-graph-wasm build

Core API

Top-level exports:

async function init(input?: InitInput): Promise<void>;
function abi_version(): number;
async function normalizeGraphSpec(spec: GraphSpec | string): Promise<GraphSpec>;
async function getNodeSchemas(): Promise<Registry>;
function getNodeRegistry(): Registry;
function findNodeSignature(typeId: NodeType | string): NodeSignature | undefined;
function requireNodeSignature(typeId: NodeType | string): NodeSignature;
function listNodeTypeIds(): NodeType[];
function groupNodeSignaturesByCategory(): Map<string, NodeSignature[]>;
async function logNodeSchemaDocs(nodeType?: NodeType | string): Promise<void>;
const graphSamples: Record<string, GraphSpec>;

Notable Graph methods:

loadGraph(
  spec: GraphSpec | string,
  opts?: { hotPaths?: string[]; epsilon?: number; autoClearDroppedHotPaths?: boolean }
): void;
stageInput(path: string, value: ValueInput, declaredShape?: ShapeJSON): void;
stageInputs(paths: string[], values: Float32Array, shapes?: (ShapeJSON | null)[]): void;
registerInputPaths(paths: string[]): Uint32Array;
prepareInputSlots(indices: Uint32Array, declaredShapes?: (ShapeJSON | null)[]): void;
stageInputsByIndex(indices: Uint32Array, values: Float32Array): void;
stageInputsBySlot(indices: Uint32Array, values: Float32Array): void;
stageInputsBySlotDiff(indices: Uint32Array, values: Float32Array, epsilon?: number): void;
setHotPaths(paths: string[], opts?: { epsilon?: number; autoClearDroppedHotPaths?: boolean }): void;
setParam(nodeId: string, key: string, value: ValueInput): void;
setTime(t: number): void;
step(dt: number): void;
evalAll(): EvalResult;
evalAllFull(): EvalResult;
getOutputsDelta(sinceVersion?: number): EvalResult & { version: number };
getOutputsBatch(nodeIds: string[]): Float32Array;
evalSteps(steps: number, dt: number): EvalResult;
clearSlot(slotIdx: number): Promise<void>;
clearInput(path: string): Promise<void>;
setDebugLogging(enabled: boolean): void;
inspectStaging(): {
  hotPaths: string[];
  epsilon: number;
  autoClearDroppedHotPaths: boolean;
  slotDiffWarm: boolean;
  lastOutputVersion: bigint;
  debugLogging: boolean;
};

Usage

import {
  init,
  Graph,
  normalizeGraphSpec,
  graphSamples,
  valueAsNumber,
} from "@vizij/node-graph-wasm";

await init();

const graph = new Graph();
const spec = await normalizeGraphSpec(graphSamples.vectorPlayground);
graph.loadGraph(spec);

graph.stageInput("demo/path", { float: 1 });
const result = graph.evalAll();

const nodeValue =
  result.nodes["const"]?.out?.value ?? { type: "float", data: NaN };
console.log("Node value", valueAsNumber(nodeValue));

Hot-path staging

graph.loadGraph(spec, {
  hotPaths: ["demo/a", "demo/b"],
  epsilon: 0,
  autoClearDroppedHotPaths: true,
});

const paths = ["demo/a", "demo/b", "demo/rare"];
const values = new Float32Array([1, 2, 3]);
graph.stageInputs(paths, values);

graph.setDebugLogging(true);
console.log(graph.inspectStaging());

Use registerInputPaths plus prepareInputSlots when you want to reuse slot indices across many frames and minimize path parsing overhead.

Fixtures And Samples

The package exports named graph samples and fixture loaders:

import { loadNodeGraphBundle } from "@vizij/node-graph-wasm";

const { spec, stage } = await loadNodeGraphBundle("urdf-ik-position");
graph.loadGraph(spec);
if (stage) {
  for (const [path, payload] of Object.entries(stage)) {
    graph.stageInput(path, payload.value, payload.shape);
  }
}

Troubleshooting

  • Selector mismatch errors usually mean the spec references an element the upstream node does not emit.
  • setParam enforces the same value-shape rules as the Rust runtime.
  • ABI mismatch means the wasm bindings need to be rebuilt with pnpm run build:wasm:graph.

Development And Testing

pnpm run build:wasm:graph
pnpm --filter @vizij/node-graph-wasm test
cargo test -p vizij-graph-wasm

The package test script rebuilds the wrapper and runs the compiled Node test bundle from dist/node-graph-wasm/tests/all.test.js.

Related Packages