Module

LayeredLayout.Compaction.LGraphToCGraphTransformer

Package
purescript-layered-layout
Repository
markgrafhq/purescript-layered-layout

Port of ELK's LGraphToCGraphTransformer adapted to markgraf's post-routing data model. Builds a compaction graph from a LayoutResult-shaped input (node placements + routed edges) and maps the compacted x-coordinates back onto those inputs.

Only orthogonal edges are supported (markgraf does not route splines). Comment boxes and external port dummies are not part of markgraf either, so those branches are dropped.

#CNodeOrigin Source

data CNodeOrigin

What kind of layered-graph object each CNode represents.

Constructors

#RoutedEdge Source

type RoutedEdge = { edgeId :: EdgeId, path :: EdgePath, src :: NodeId, srcSide :: Side, tgt :: NodeId, tgtSide :: Side }

#TransformInput Source

type TransformInput = { edges :: Array Edge, nodes :: Array NodePlacement, paths :: Array EdgePath, ports :: Map NodeId (Array Port) }

#TransformOutput Source

type TransformOutput = { cGraph :: CGraph CNodeOrigin, edgeToCs :: Map EdgeId (Array CNodeId), lockMap :: Map CNodeId Quadruplet, nodeToC :: Map NodeId CNodeId }

#applyLayout Source

applyLayout :: CGraph CNodeOrigin -> { edges :: Array Edge, nodes :: Array NodePlacement, paths :: Array EdgePath } -> { edges :: Array EdgePath, nodes :: Array NodePlacement }