Skip to main content

deserializePipeline

megane-viewer


megane-viewer / deserializePipeline

Function: deserializePipeline()

deserializePipeline(json): object

Defined in: pipeline/serialize.ts:69

Deserialize the portable JSON format into xyflow nodes and edges.

Also normalizes the graph to the canonical "LoadStructure → AddBond → Viewport" shape: if the saved pipeline lacks an AddBond node connecting a LoadStructure to the Viewport, one is injected with the standard wiring (particle, cell, bond, and — when the loader carries a trajectory — trajectory edges). This guards against older / hand-written .megane.json files that only wired LoadStructure.particle → Viewport.particle and therefore rendered without bonds.

Parameters

json

SerializedPipeline

Returns

object

edges

edges: Edge[]

nodes

nodes: Node<PipelineNodeData>[]