ParaShape

BaseNode

Source: packages/parametric/src/nodes/BaseNode.ts

Properties

NameTypeDescription
errorstringLast error message; empty string when valid, undefined after a successful eval.
valueunknownCached evaluated value; undefined when the node is in an error state.
isDirtybooleanTrue when the node needs re-evaluation before its value can be trusted.
pendingbooleanTrue while an async compute() is in flight (its result hasn't settled yet).
_epochnumberBumped on every dirty (see setDirty/markDirty) — a stale async settle compares its captured epoch against the current one and discards itself on mismatch (a newer edit superseded it while it was in flight).
owneranyWalk up to the nearest owner that has a nodes collection (ModelScope).

Methods

SignatureDescription
compute(): unknownCompute the raw value for this node; override in subclasses to produce actual output.
evaluate(listener?: () => void): unknownEvaluate this node, cache the result, and notify dependents; returns the cached value. When compute() returns a thenable, this returns the prior (stale) value synchronously and settles later — see core/maybeAsync.ts.
display(listener?: () => void): voidReturn the human-readable display string for this node's value (or its error message).
isPending(listener?: () => void): voidTrue while an async compute() is still settling (see pending).
setError(message: string): voidSet an error message on this node and notify listeners. Fires "error" (specific) and "change" (the universal event — see ParameterNode.setKey's doc).
copy(): voidDuplicate this node in its collection, inserting it right after the original.