LayeredLayout.Compaction.NetworkSimplexCompaction
- Package
- purescript-layered-layout
- Repository
- markgrafhq/purescript-layered-layout
Phase 3 of the post-routing graph compaction port.
An ICompactionAlgorithm implementation that drives the generic
LayeredLayout.NetworkSimplex core. Port of ELK's
org.eclipse.elk.alg.layered.intermediate.compaction.NetworkSimplexCompaction.
The ELK version is hard-coded against LNode / VerticalSegment
to add edge-length constraints and pick weights for vertical-segment
/ node pairs. Here that knowledge is supplied by the caller via a
CompactionHooks a record so the algorithm stays polymorphic in
the origin type. The phase 4 transformer fills in non-default
hooks; callers that only need separation constraints can pass
defaultHooks.
#CompactionHooks Source
type CompactionHooks a = { edgeLengthEdges :: CGraph a -> Array ExtraEdge, portAnchoredSegment :: CNode a -> Boolean, sameEdgeVerticalSegments :: CNode a -> CNode a -> Boolean, vsLNodePair :: CNode a -> CNode a -> Boolean }Hooks the layered-graph bridge supplies so this algorithm can
reproduce ELK's addEdgeConstraints and the VS-vs-LNode weight
bump without knowing anything about LNode / VerticalSegment.
#defaultHooks Source
defaultHooks :: forall a. CompactionHooks a#networkSimplexCompaction Source
networkSimplexCompaction :: forall a. CompactionHooks a -> ICompactionAlgorithm aThe compaction algorithm. Build a network-simplex graph from the
constraint graph, run the simplex, and write the resulting layer
values back into each CNode's hitbox.x.
#separationWeight Source
separationWeight :: NumberConstants matching ELK's NetworkSimplexCompaction.
#edgeWeight Source
edgeWeight :: Number- 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