Declares a reusable node type and returns a factory for it.
const Stats = defineNode({ kind: 'stats', inputs: { series: port<TimeSeries<Schema>>() }, outputs: { mean: port<number>(), max: port<number>() }, compute: ({ series }) => ({ mean: series.column('cpu').mean(), max: series.column('cpu').max(), }),});const stats = Stats();raw.out.value.connect(stats.in.series);stats.out.mean.get(); Copy
const Stats = defineNode({ kind: 'stats', inputs: { series: port<TimeSeries<Schema>>() }, outputs: { mean: port<number>(), max: port<number>() }, compute: ({ series }) => ({ mean: series.column('cpu').mean(), max: series.column('cpu').max(), }),});const stats = Stats();raw.out.value.connect(stats.in.series);stats.out.mean.get();
For a node type that needs per-instance configuration, close over it: const smoother = (span: number) => defineNode({ ... })();
const smoother = (span: number) => defineNode({ ... })();
Declares a reusable node type and returns a factory for it.
For a node type that needs per-instance configuration, close over it:
const smoother = (span: number) => defineNode({ ... })();