LayeredLayout.CoordAssignment
- Package
- purescript-layered-layout
- Repository
- markgrafhq/purescript-layered-layout
Brandes-Köpf node placement algorithm.
#assign Source
assign :: Random -> CoordConfig -> Array Constraints -> Array (Array NodeId) -> Map NodeId GridSize -> NodeMargins -> Map NodeId (Array Port) -> Array Edge -> Array { edgeId :: EdgeId, nodes :: Array NodeId } -> EdgePortOffsets -> { placements :: Array NodePlacement, random :: Random, slots :: Map EdgeId SlotInfo }Assign coordinates in grid units without rounding.
The chains argument carries the dummy-edge groupings produced by
DummyNodes.insertDummies; we need them to estimate inter-layer
routing widths via the same hyperedge segment pipeline that the
router itself runs (ports of OrthogonalRoutingGenerator and
OrthogonalEdgeRouter.process).
#assignFine Source
assignFine :: CoordConfig -> Array (Array NodeId) -> Map NodeId GridSize -> NodeMargins -> Map NodeId (Array Port) -> Array Edge -> EdgePortOffsets -> Map NodeId NumberAssign coordinates in fine-grid resolution (no rounding).
#assignFineDiag Source
assignFineDiag :: CoordConfig -> Array (Array NodeId) -> Map NodeId GridSize -> NodeMargins -> Map NodeId (Array Port) -> Array Edge -> EdgePortOffsets -> DiagSame as assignFine but returns rich per-pass diagnostics for
inspection. Used only by debug specs.
#CoordConfig Source
type CoordConfig = { layerGap :: Int, nodeGap :: Int }#Diag Source
type Diag = { balanced :: Map NodeId Number, chosen :: Map NodeId Number, chosenLabel :: Chosen, layers :: Array (Array NodeId), markedEdges :: Array MarkedEdge, passes :: Array PassDiag }Top-level diagnostic returned by assignFineDiag. Captures the
inputs (layers, dummy-augmented edges) and the per-pass + balanced
output so external code can inspect BK's intermediate state without
needing access to internals.
#PassDiag Source
type PassDiag = { align :: Map NodeId NodeId, hdir :: HDir, innerShift :: Map NodeId Number, postProcessTrace :: Array PostProcessTrace, queue :: Array Postprocessable, root :: Map NodeId NodeId, vdir :: VDir, x :: Map NodeId Number }Per-pass diagnostic: aligned blocks (root,align maps), inner shifts,
and final x map for one of the four BK passes. Also includes the
accumulated Postprocessable queue (after placeBlock, before
postProcess) and a per-item trace of what postProcess did.
#Postprocessable Source
type Postprocessable = { free :: NodeId, isRoot :: Boolean }Port of ThresholdStrategy.Postprocessable: a deferred edge-straighten
candidate. free is the block-side node (root or last); isRoot
mirrors ELK's flag so pickEdge knows which incident-edge set to
scan during the post-process pass.
#PostProcessTrace Source
type PostProcessTrace = { avail :: Number, candCount :: Int, delta :: Number, edgeId :: Maybe EdgeId, freeSu :: Boolean, hasEdges :: Boolean, phase :: PostProcessPhase, ppFree :: NodeId, ppIsRoot :: Boolean, shift :: Number }Trace entry for one Postprocessable processed by postProcess.
shift is the actual delta applied to the block (zero when no
movement happened). freeSu, hasEdges, candCount expose why
a given pp couldn't be straightened (skipped due to su, or no
valid edges, etc.).
#PostProcessPhase Source
data PostProcessPhaseWhich drain phase a PostProcessTrace entry came from. ELK's
_.postProcess first drains the FIFO queue (forward), pushing
failed items onto a stack, then drains the stack in reverse.
Constructors
Instances
#Chosen Source
data ChosenWhich of the four candidate layouts was picked. Balanced is the
median-of-four; SmallestFeasible is the smallest-width directional
layout when the median violates order constraints; FirstFallback is
the last-resort first directional layout when none were feasible.
Constructors
Instances
#MarkedEdge Source
newtype MarkedEdgeSynthetic key identifying a marked (type-1 conflict) edge.
Built from the two endpoint NodeIds by edgeKey; opaque otherwise.
Constructors
Instances
- Modules
- LayeredLayout
- LayeredLayout.
Aesthetics - LayeredLayout.
Compaction. EdgeAwareScanlineConstraints - LayeredLayout.
Compaction. HorizontalGraphCompactor - LayeredLayout.
Compaction. LGraphToCGraphTransformer - LayeredLayout.
Compaction. NetworkSimplexCompaction - LayeredLayout.
Compaction. OneD - LayeredLayout.
Compaction. VerticalSegment - LayeredLayout.
Components - LayeredLayout.
CoordAssignment - LayeredLayout.
CrossingMin - LayeredLayout.
CrossingMin. Constraints - LayeredLayout.
CrossingMin. NorthSouth - LayeredLayout.
CrossingMin. Ports - LayeredLayout.
CycleRemoval - LayeredLayout.
DummyNodes - LayeredLayout.
EdgeLabels - LayeredLayout.
EdgeLabels. SelfLoops - LayeredLayout.
EdgeLabels. SelfLoops. Model - LayeredLayout.
EdgeLabels. SelfLoops. Routing - LayeredLayout.
EdgeRouting - LayeredLayout.
EdgeRouting. HyperEdgeCycleDetector - LayeredLayout.
EdgeRouting. HyperEdges - LayeredLayout.
EdgeRouting. LineJump - LayeredLayout.
EdgeRouting. Orthogonal - LayeredLayout.
EdgeRouting. PortAssignment - LayeredLayout.
Graph - LayeredLayout.
Grid - LayeredLayout.
JavaRandom - LayeredLayout.
LayerAssignment - LayeredLayout.
LayerAssignment. NetworkSimplex - LayeredLayout.
NetworkSimplex - LayeredLayout.
PortDistribution - LayeredLayout.
PortDummies - LayeredLayout.
Result