Pipeline
megane-viewer / Pipeline
Class: Pipeline
Defined in: pipeline/builder.ts:474
Pipeline graph builder.
Build a DAG of processing nodes and serialize to the SerializedPipeline v3 JSON format understood by the TypeScript pipeline engine.
A Viewport node must be explicitly added and connected for data to be rendered.
Example:
const pipe = new Pipeline() const s = pipe.addNode(new LoadStructure('protein.pdb')) const v = pipe.addNode(new Viewport()) pipe.addEdge(s.out.particle, v.inp.particle) const json = pipe.toJSON()
Constructors
Constructor
new Pipeline():
Pipeline
Returns
Pipeline
Methods
addEdge()
addEdge(
source,target):void
Defined in: pipeline/builder.ts:513
Connect a source port to a target port.
Both ports must belong to nodes already added to this pipeline:
pipe.addEdge(s.out.particle, f.inp.particle) pipe.addEdge(f.out.particle, v.inp.particle)
Parameters
source
NodePort
target
NodePort
Returns
void
addNode()
addNode<
T>(node):T
Defined in: pipeline/builder.ts:487
Add a node to the pipeline.
Returns the same node instance so its ports can be used in addEdge():
const s = pipe.addNode(new LoadStructure('protein.pdb')) pipe.addEdge(s.out.particle, ...)
Type Parameters
T
T extends PipelineNode
Parameters
node
T
Returns
T
toJSON()
toJSON(
indent?):string
Defined in: pipeline/builder.ts:549
Serialize to a JSON string (SerializedPipeline v3).
Parameters
indent?
number = 2
Returns
string
toObject()
toObject():
SerializedPipeline
Defined in: pipeline/builder.ts:538
Serialize to SerializedPipeline v3 format as a plain object.