Module

LayeredLayout.EdgeLabels

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

#EndLabelAlignment Source

data EndLabelAlignment

TAIL labels follow their authored source even when cycle removal reverses the routing direction. Adjacent is ELK's end-label behaviour; the explicit terminal-run mode is a renderer-neutral extension.

Constructors

Instances

#EdgeLabelSpec Source

type EdgeLabelSpec = { placement :: LabelPlacement, size :: GridSize }

#LabelState Source

type LabelState = { dummies :: Array LabelDummy, edges :: Array Edge, nodes :: Array Node, reservations :: Map EdgeId NodeId, specs :: Map EdgeId EdgeLabelSpec }

#LabelDummy Source

type LabelDummy = { edge :: Edge, node :: NodeId, side :: LabelSide, size :: GridSize, tail :: EdgeId }

#LabelSide Source

data LabelSide

Constructors

#TailCell Source

type TailCell = { edge :: EdgeId, height :: Number, reservation :: NodeId, side :: Side, source :: NodeId, width :: Number, x :: Number, y :: Number }

#TailCells Source

type TailCells = { cells :: Array TailCell, margins :: NodeMargins }

#prepareTailCells Source

prepareTailCells :: NodeMargins -> Graph -> LabelState -> Array { edgeId :: EdgeId, nodes :: Array NodeId } -> EdgePortOffsets -> Map NodeId GridSize -> TailCells

Measure every tail cell in its authored source's physical coordinate system before coordinate assignment. The resulting envelope feeds layer sizing; materialization later is only a translation by the source's physical placement, so it cannot grow a planned routing gap afterwards.

#routingObstacles Source

routingObstacles :: TailCells -> Array NodePlacement -> Array NodePlacement

Materialize pre-measured source-local cells after physical owner placements are known. Do not recalculate side choice or stacking here: the exact cells that sized the layer gaps must be the routing obstacles.

#switchDummies Source

switchDummies :: LabelState -> DummyResult -> { dummies :: DummyResult, labels :: LabelState }

#tailPlacements Source

tailPlacements :: NodeMargins -> Graph -> LabelState -> Array NodePlacement -> Array EdgePath -> Map EdgeId EdgeLabelPlacement -> Array EdgeLabelPlacement -> Array EdgeLabelPlacement

Final source-owned placement runs after routing and compaction. Bent terminal runs center along their own axis; their compacted reservation is retained as the only fallback when route-adjacent candidates are blocked.