/** * Walks upstream from a flow node and collects scale channels whose current * domain affects the produced data. Downstream encodings on these channels * must not re-register as domain contributors or they will invalidate the * domain that they themselves depend on. * * @param {FlowNode | undefined} node * @returns {Set} */ export function collectDomainSensitiveScaleChannels(node: FlowNode | undefined): Set; /** * @param {import("../types/flowBatch.js").FlowBatch} flowBatch * @returns {flowBatch is import("../types/flowBatch.js").FileBatch} */ export function isFileBatch(flowBatch: import("../types/flowBatch.js").FlowBatch): flowBatch is import("../types/flowBatch.js").FileBatch; /** * @param {import("../types/flowBatch.js").FlowBatch} flowBatch * @returns {flowBatch is import("../types/flowBatch.js").FacetBatch} */ export function isFacetBatch(flowBatch: import("../types/flowBatch.js").FlowBatch): flowBatch is import("../types/flowBatch.js").FacetBatch; /** * The FlowNode clones the data objects passing through or creates entirely * new objects. */ export const BEHAVIOR_CLONES: number; /** * FlowNode modifies the objects that pass through. Creating defensive copies * (clones) in an upstream node may be appropriate, depending on branching. */ export const BEHAVIOR_MODIFIES: number; /** * The flow node collects data objects and may emit the to its children. * The collected data objects must not be modified by downstream transforms. */ export const BEHAVIOR_COLLECTS: number; /** * @typedef {object} ParamRuntimeProvider * @prop {import("../paramRuntime/viewParamRuntime.js").default} [paramRuntime] * @prop {import("../types/viewContext.js").default} [context] */ /** * This is heavily inspired by Vega's and Vega-Lite's data flow system. * * @typedef {Record} Datum * @typedef {Datum[]} Data */ export default class FlowNode { /** * @param {ParamRuntimeProvider} [paramRuntimeProvider] */ constructor(paramRuntimeProvider?: ParamRuntimeProvider); stats: { count: number; /** @type {Datum} */ first: Datum; }; /** * An object that provides a paramRuntime. (Most likely a View) * * @type {ParamRuntimeProvider} */ paramRuntimeProvider: ParamRuntimeProvider; get behavior(): number; /** * Scale channels whose current domain affects this node's output. * Downstream views must not feed these channels back into shared-domain * resolution or domain-dependent flows can invalidate themselves. * * @returns {import("../spec/channel.js").ChannelWithScale[]} */ get domainSensitiveScaleChannels(): import("../spec/channel.js").ChannelWithScale[]; /** * A human-readable label for the node. Used for debugging and logging. * * @returns {string} */ get label(): string; /** @type {FlowNode[]} */ children: FlowNode[]; /** @type {FlowNode} */ parent: FlowNode; /** True if all data have been processed */ completed: boolean; get disposed(): boolean; /** * Resets the node and all its descendants to their initial state, i.e., preparing * for a new batch of data. */ reset(): void; /** * Allows for doing final initialization after the flow structure has been * built and optimized. Must be called before any data are to be propagated. * Note: Some transforms call initialize() from reset() to rebuild internal * fast paths per batch. Use initializeOnce() for graph-level init to avoid * double-initialization issues. */ initialize(): void; /** * Calls initialize() once per node instance. Intended for graph-level init * passes that should not rerun when reusing existing branches. */ initializeOnce(): void; /** * @param {Datum} datum * @protected */ protected _propagate(datum: Datum): void; /** * * @param {FlowNode} parent */ setParent(parent: FlowNode): void; /** * * @param {FlowNode} child */ addChild(child: FlowNode): this; /** * @param {FlowNode} node */ adopt(node: FlowNode): void; /** * @param {FlowNode} otherParent */ adoptChildrenOf(otherParent: FlowNode): void; /** * @param {FlowNode} newParent */ insertAsParent(newParent: FlowNode): void; /** * * @param {FlowNode} child */ removeChild(child: FlowNode): void; /** * Removes this node and ligates (connects) the preceding and succeeding nodes. */ excise(): void; isRoot(): boolean; isBranching(): boolean; isTerminal(): boolean; /** * Visits child nodes in depth-first order. * * @param {(function(FlowNode):void) & { afterChildren?: function(FlowNode):void}} visitor */ visit(visitor: ((arg0: FlowNode) => void) & { afterChildren?: (arg0: FlowNode) => void; }): void; /** * @param {number} [depth] * @returns {string} */ subtreeToString(depth?: number): string; /** * * @param {Datum} datum */ handle(datum: Datum): void; complete(): void; /** * Register a disposer to be executed when this node is disposed. * * @param {() => void} disposer */ registerDisposer(disposer: () => void): void; /** * Release resources owned by this flow node. */ dispose(): void; /** * Dispose this flow node and all descendants in post-order. */ disposeSubtree(): void; /** * Signals that a new batch of data will be propagated. * * @param {import("../types/flowBatch.js").FlowBatch} flowBatch */ beginBatch(flowBatch: import("../types/flowBatch.js").FlowBatch): void; /** * @returns {import("../paramRuntime/viewParamRuntime.js").default} * @protected */ protected get paramRuntime(): import("../paramRuntime/viewParamRuntime.js").default; /** * Repropagates the stored data. If this node has no stored data, * find the nearest ancestor that has and repropagate from there. * @protected */ protected repropagate(): void; #private; } export type ParamRuntimeProvider = { paramRuntime?: import("../paramRuntime/viewParamRuntime.js").default; context?: import("../types/viewContext.js").default; }; /** * This is heavily inspired by Vega's and Vega-Lite's data flow system. */ export type Datum = Record; /** * This is heavily inspired by Vega's and Vega-Lite's data flow system. */ export type Data = Datum[]; //# sourceMappingURL=flowNode.d.ts.map