/
Layered.melk
1099 lines (960 loc) · 44.1 KB
/
Layered.melk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
* Copyright (c) 2015, 2020 Kiel University and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.elk.alg.layered
import java.util.List
import org.eclipse.elk.alg.layered.LayeredLayoutProvider
import org.eclipse.elk.alg.layered.components.ComponentOrderingStrategy
import org.eclipse.elk.core.math.ElkPadding
import org.eclipse.elk.core.options.Direction
import org.eclipse.elk.core.options.EdgeRouting
import org.eclipse.elk.core.options.HierarchyHandling
import org.eclipse.elk.core.options.PortAlignment
import org.eclipse.elk.core.util.ExclusiveBounds
/**
* Declarations for the ELK Layered layout algorithm.
*/
bundle {
metadataClass options.LayeredMetaDataProvider
idPrefix org.eclipse.elk.layered
}
algorithm layered(LayeredLayoutProvider) {
label "ELK Layered"
description
"Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as
possible into one direction by placing nodes into subsequent layers. This implementation
supports different routing styles (straight, orthogonal, splines); if orthogonal routing is
selected, arbitrary port constraints are respected, thus enabling the layout of block
diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of
compound graphs with cross-hierarchy edges is supported when the respective option is
activated on the top level."
metadataClass options.LayeredOptions
category org.eclipse.elk.layered
features self_loops, inside_self_loops, multi_edges, edge_labels, ports, compound, clusters
preview images/layered_layout.png
// general spacings
supports org.eclipse.elk.spacing.commentComment
supports org.eclipse.elk.spacing.commentNode
supports org.eclipse.elk.spacing.componentComponent
supports org.eclipse.elk.spacing.edgeEdge
supports org.eclipse.elk.spacing.edgeLabel
supports org.eclipse.elk.spacing.edgeNode
supports org.eclipse.elk.spacing.labelLabel
supports org.eclipse.elk.spacing.labelPortHorizontal
supports org.eclipse.elk.spacing.labelPortVertical
supports org.eclipse.elk.spacing.labelNode
supports org.eclipse.elk.spacing.nodeNode
supports org.eclipse.elk.spacing.nodeSelfLoop
supports org.eclipse.elk.spacing.portPort
supports org.eclipse.elk.spacing.individual
documentation "Most parts of the algorithm do not support this yet."
// layer-based spacings
supports org.eclipse.elk.alg.layered.spacing.baseValue
supports org.eclipse.elk.alg.layered.spacing.edgeEdgeBetweenLayers
supports org.eclipse.elk.alg.layered.spacing.edgeNodeBetweenLayers
supports org.eclipse.elk.alg.layered.spacing.nodeNodeBetweenLayers
// layer-based priorities
supports org.eclipse.elk.priority = 0
documentation "Used by the 'simple row graph placer' to decide which connected components to place first.
A component's priority is the sum of the node priorities,
and components with higher priorities will be placed
before components with lower priorities."
supports priority.direction
supports priority.shortness
documentation "Currently only supported by the network simplex layerer."
supports priority.straightness
// wrapping related
supports wrapping.strategy
supports wrapping.additionalEdgeSpacing
supports wrapping.correctionFactor
supports wrapping.cutting.strategy
supports wrapping.cutting.cuts
supports wrapping.cutting.msd.freedom
supports wrapping.validify.strategy
supports wrapping.validify.forbiddenIndices
supports wrapping.multiEdge.improveCuts
supports wrapping.multiEdge.distancePenalty
supports wrapping.multiEdge.improveWrappedEdges
// flexible nodes during node placement
supports nodePlacement.networkSimplex.nodeFlexibility
supports nodePlacement.networkSimplex.nodeFlexibility.^default
// splines
supports edgeRouting.splines.mode
supports edgeRouting.splines.sloppy.layerSpacingFactor
// other options
supports org.eclipse.elk.padding = new ElkPadding(12)
supports org.eclipse.elk.edgeRouting = EdgeRouting.ORTHOGONAL
supports org.eclipse.elk.port.borderOffset = 0
supports org.eclipse.elk.randomSeed = 1
supports org.eclipse.elk.aspectRatio = 1.6f
supports org.eclipse.elk.noLayout
supports org.eclipse.elk.portConstraints
supports org.eclipse.elk.port.side
supports org.eclipse.elk.debugMode
supports org.eclipse.elk.alignment
supports org.eclipse.elk.hierarchyHandling
supports org.eclipse.elk.separateConnectedComponents = true
supports org.eclipse.elk.insideSelfLoops.activate
supports org.eclipse.elk.insideSelfLoops.yo
supports org.eclipse.elk.nodeSize.constraints
supports org.eclipse.elk.nodeSize.options
supports org.eclipse.elk.nodeSize.fixedGraphSize
supports org.eclipse.elk.direction = Direction.UNDEFINED
supports org.eclipse.elk.nodeLabels.placement
supports org.eclipse.elk.nodeLabels.padding
supports org.eclipse.elk.portLabels.placement
supports org.eclipse.elk.portLabels.nextToPortIfPossible
supports org.eclipse.elk.portLabels.treatAsGroup
supports org.eclipse.elk.portAlignment.^default = PortAlignment.JUSTIFIED
supports org.eclipse.elk.portAlignment.north
supports org.eclipse.elk.portAlignment.south
supports org.eclipse.elk.portAlignment.west
supports org.eclipse.elk.portAlignment.east
supports unnecessaryBendpoints
supports org.eclipse.elk.alg.layered.layering.strategy
supports org.eclipse.elk.alg.layered.layering.nodePromotion.strategy
supports thoroughness
supports org.eclipse.elk.alg.layered.layering.layerConstraint
supports org.eclipse.elk.alg.layered.cycleBreaking.strategy
supports org.eclipse.elk.alg.layered.crossingMinimization.strategy
supports org.eclipse.elk.alg.layered.crossingMinimization.forceNodeModelOrder
supports org.eclipse.elk.alg.layered.crossingMinimization.greedySwitch.activationThreshold
supports org.eclipse.elk.alg.layered.crossingMinimization.greedySwitch.type
supports org.eclipse.elk.alg.layered.crossingMinimization.greedySwitchHierarchical.type
supports org.eclipse.elk.alg.layered.crossingMinimization.semiInteractive
supports mergeEdges
supports mergeHierarchyEdges
supports interactiveReferencePoint
supports org.eclipse.elk.alg.layered.nodePlacement.strategy
supports org.eclipse.elk.alg.layered.nodePlacement.bk.fixedAlignment
supports feedbackEdges
supports org.eclipse.elk.alg.layered.nodePlacement.linearSegments.deflectionDampening
supports org.eclipse.elk.alg.layered.edgeRouting.selfLoopDistribution
supports org.eclipse.elk.alg.layered.edgeRouting.selfLoopOrdering
supports org.eclipse.elk.contentAlignment
supports org.eclipse.elk.alg.layered.nodePlacement.bk.edgeStraightening
supports org.eclipse.elk.alg.layered.compaction.postCompaction.strategy
supports org.eclipse.elk.alg.layered.compaction.postCompaction.constraints
supports org.eclipse.elk.alg.layered.compaction.connectedComponents
supports org.eclipse.elk.alg.layered.highDegreeNodes.treatment
supports org.eclipse.elk.alg.layered.highDegreeNodes.threshold
supports org.eclipse.elk.alg.layered.highDegreeNodes.treeHeight
supports org.eclipse.elk.nodeSize.minimum
supports org.eclipse.elk.junctionPoints
supports org.eclipse.elk.edge.thickness
supports org.eclipse.elk.edgeLabels.placement
supports org.eclipse.elk.edgeLabels.inline
supports org.eclipse.elk.alg.layered.crossingMinimization.hierarchicalSweepiness
supports org.eclipse.elk.port.index
supports org.eclipse.elk.commentBox
supports org.eclipse.elk.hypernode
supports org.eclipse.elk.port.anchor
supports org.eclipse.elk.partitioning.activate
supports org.eclipse.elk.partitioning.partition
supports org.eclipse.elk.alg.layered.layering.minWidth.upperBoundOnWidth
supports org.eclipse.elk.alg.layered.layering.minWidth.upperLayerEstimationScalingFactor
supports org.eclipse.elk.position
supports allowNonFlowPortsToSwitchSides
supports org.eclipse.elk.alg.layered.layering.nodePromotion.maxIterations
supports edgeLabels.sideSelection
supports edgeLabels.centerLabelPlacementStrategy
supports org.eclipse.elk.margins
supports layering.coffmanGraham.layerBound
supports nodePlacement.favorStraightEdges
supports org.eclipse.elk.spacing.portsSurrounding
supports directionCongruency
supports portSortingStrategy
supports edgeRouting.polyline.slopedEdgeZoneWidth
supports layering.layerChoiceConstraint
supports crossingMinimization.positionChoiceConstraint
supports org.eclipse.elk.interactiveLayout
supports layering.layerId
supports crossingMinimization.positionId
supports considerModelOrder.strategy
supports considerModelOrder.longEdgeStrategy
supports considerModelOrder.crossingCounterNodeInfluence
supports considerModelOrder.crossingCounterPortInfluence
supports considerModelOrder.noModelOrder
supports considerModelOrder.components
supports generatePositionAndLayerIds
}
/* ------------------------
* phase 1
* ------------------------*/
group cycleBreaking {
option strategy: CycleBreakingStrategy {
label "Cycle Breaking Strategy"
description
"Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines
which edges to reverse to break the cycles. Reversed edges will end up pointing to the
opposite direction of regular edges (that is, reversed edges will point left if edges
usually point right)."
default = CycleBreakingStrategy.GREEDY
targets parents
}
}
/* ------------------------
* phase 2
* ------------------------*/
group layering {
option strategy: LayeringStrategy {
label "Node Layering Strategy"
description
"Strategy for node layering."
default = LayeringStrategy.NETWORK_SIMPLEX
targets parents
}
advanced option layerConstraint: LayerConstraint {
label "Layer Constraint"
description
"Determines a constraint on the placement of the node regarding the layering."
default = LayerConstraint.NONE
targets nodes
}
advanced option layerChoiceConstraint: int {
label "Layer Choice Constraint"
description
"Allows to set a constraint regarding the layer placement of a node.
Let i be the value of teh constraint. Assumed the drawing has n layers and i < n.
If set to i, it expresses that the node should be placed in i-th layer.
Should i>=n be true then the node is placed in the last layer of the drawing.
Note that this option is not part of any of ELK Layered's default configurations
but is only evaluated as part of the `InteractiveLayeredGraphVisitor`,
which must be applied manually or used via the `DiagramLayoutEngine."
default = -1
lowerBound = -1
targets nodes
}
output option layerId: int {
label "Layer ID"
description
"Layer identifier that was calculated by ELK Layered for a node.
This is only generated if interactiveLayot or generatePositionAndLayerIds is set."
default = -1
lowerBound = -1
targets nodes
}
group minWidth {
advanced option upperBoundOnWidth: int {
label "Upper Bound On Width [MinWidth Layerer]"
description
"Defines a loose upper bound on the width of the MinWidth layerer.
If set to '-1' multiple values are tested and the best result is selected."
default = 4
lowerBound = -1
targets parents
requires org.eclipse.elk.alg.layered.layering.strategy == LayeringStrategy.MIN_WIDTH
}
advanced option upperLayerEstimationScalingFactor: int {
label "Upper Layer Estimation Scaling Factor [MinWidth Layerer]"
description
"Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which
haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth
algorithm. Compensates for too high estimations.
If set to '-1' multiple values are tested and the best result is selected."
default = 2
lowerBound = -1
targets parents
requires org.eclipse.elk.alg.layered.layering.strategy == LayeringStrategy.MIN_WIDTH
}
}
group nodePromotion {
advanced option strategy: NodePromotionStrategy {
label "Node Promotion Strategy"
description
"Reduces number of dummy nodes after layering phase (if possible)."
default = NodePromotionStrategy.NONE
targets parents
}
advanced option maxIterations: int {
label "Max Node Promotion Iterations"
description
"Limits the number of iterations for node promotion."
default = 0
lowerBound = 0
targets parents
requires org.eclipse.elk.alg.layered.layering.nodePromotion.strategy
}
}
group coffmanGraham {
advanced option layerBound: int {
label "Layer Bound"
description
"The maximum number of nodes allowed per layer."
default = Integer.MAX_VALUE
targets parents
requires org.eclipse.elk.alg.layered.layering.strategy == LayeringStrategy.COFFMAN_GRAHAM
}
}
}
/* ------------------------
* phase 3
* ------------------------*/
group crossingMinimization {
option strategy: CrossingMinimizationStrategy {
label "Crossing Minimization Strategy"
description
"Strategy for crossing minimization."
default = CrossingMinimizationStrategy.LAYER_SWEEP
targets parents
}
option forceNodeModelOrder: boolean {
label "Force Node Model Order"
description
"The node order given by the model does not change to produce a better layout. E.g. if node A
is before node B in the model this is not changed during crossing minimization. This assumes that the
node model order is already respected before crossing minimization. This can be achieved by setting
considerModelOrder.strategy to NODES_AND_EDGES."
default = false
targets parents
}
advanced option hierarchicalSweepiness: double {
label "Hierarchical Sweepiness"
description
"How likely it is to use cross-hierarchy (1) vs bottom-up (-1)."
default = 0.1
targets parents
requires org.eclipse.elk.hierarchyHandling == HierarchyHandling.INCLUDE_CHILDREN
}
group greedySwitch {
advanced option activationThreshold: int {
label "Greedy Switch Activation Threshold"
description
"By default it is decided automatically if the greedy switch is activated or not.
The decision is based on whether the size of the input graph (without dummy nodes)
is smaller than the value of this option. A '0' enforces the activation."
default = 40
targets parents
lowerBound = 0
}
advanced option type: GreedySwitchType {
label "Greedy Switch Crossing Minimization"
description
"Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed
after the regular crossing minimization as a post-processor.
Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type'
option must be used."
default = GreedySwitchType.TWO_SIDED
targets parents
requires crossingMinimization.strategy == CrossingMinimizationStrategy.LAYER_SWEEP
}
}
group greedySwitchHierarchical {
advanced option type: GreedySwitchType {
label "Greedy Switch Crossing Minimization (hierarchical)"
description
"Activates the greedy switch heuristic in case hierarchical layout is used.
The differences to the non-hierarchical case (see 'greedySwitch.type') are:
1) greedy switch is inactive by default,
3) only the option value set on the node at which hierarchical layout starts is relevant, and
2) if it's activated by the user, it properly addresses hierarchy-crossing edges."
default = GreedySwitchType.OFF
targets parents
requires crossingMinimization.strategy == CrossingMinimizationStrategy.LAYER_SWEEP
requires org.eclipse.elk.hierarchyHandling == HierarchyHandling.INCLUDE_CHILDREN
}
}
advanced option semiInteractive: boolean {
label "Semi-Interactive Crossing Minimization"
description
"Preserves the order of nodes within a layer but still minimizes crossings between edges connecting
long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position'
layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints."
default = false
targets parents
requires crossingMinimization.strategy == CrossingMinimizationStrategy.LAYER_SWEEP
}
advanced option positionChoiceConstraint: int {
label "Position Choice Constraint"
description
"Allows to set a constraint regarding the position placement of a node in a layer.
Assumed the layer in which the node placed includes n other nodes and i < n.
If set to i, it expresses that the node should be placed at the i-th position.
Should i>=n be true then the node is placed at the last position in the layer.
Note that this option is not part of any of ELK Layered's default configurations
but is only evaluated as part of the `InteractiveLayeredGraphVisitor`,
which must be applied manually or used via the `DiagramLayoutEngine. "
default = -1
lowerBound = -1
targets nodes
}
output option positionId: int {
label "Position ID"
description
"Position within a layer that was determined by ELK Layered for a node.
This is only generated if interactiveLayot or generatePositionAndLayerIds is set."
default = -1
lowerBound = -1
targets nodes
}
}
/* ------------------------
* phase 4
* ------------------------*/
group nodePlacement {
option strategy: NodePlacementStrategy {
label "Node Placement Strategy"
description
"Strategy for node placement."
default = NodePlacementStrategy.BRANDES_KOEPF
targets parents
}
option favorStraightEdges: boolean {
label "Favor Straight Edges Over Balancing"
description
"Favor straight edges over a balanced node placement.
The default behavior is determined automatically based on the used 'edgeRouting'.
For an orthogonal style it is set to true, for all other styles to false."
// no default, see description
targets parents
requires strategy == NodePlacementStrategy.NETWORK_SIMPLEX
requires strategy == NodePlacementStrategy.BRANDES_KOEPF
}
group bk {
advanced option edgeStraightening: EdgeStraighteningStrategy {
label "BK Edge Straightening"
description
"Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges
at the expense of diagram size.
There is a subtle difference to the 'favorStraightEdges' option, which decides whether
a balanced placement of the nodes is desired, or not. In bk terms this means combining the four
alignments into a single balanced one, or not. This option on the other hand tries to straighten
additional edges during the creation of each of the four alignments."
default = EdgeStraighteningStrategy.IMPROVE_STRAIGHTNESS
targets parents
requires org.eclipse.elk.alg.layered.nodePlacement.strategy == NodePlacementStrategy.BRANDES_KOEPF
}
advanced option fixedAlignment: FixedAlignment {
label "BK Fixed Alignment"
description
"Tells the BK node placer to use a certain alignment (out of its four) instead of the
one producing the smallest height, or the combination of all four."
default = FixedAlignment.NONE
targets parents
requires org.eclipse.elk.alg.layered.nodePlacement.strategy == NodePlacementStrategy.BRANDES_KOEPF
}
}
group linearSegments {
advanced option deflectionDampening: double {
label "Linear Segments Deflection Dampening"
description
"Dampens the movement of nodes to keep the diagram from getting too large."
default = 0.3
lowerBound = ExclusiveBounds.greaterThan(0)
targets parents
requires org.eclipse.elk.alg.layered.nodePlacement.strategy == NodePlacementStrategy.LINEAR_SEGMENTS
}
}
group networkSimplex {
advanced option nodeFlexibility: NodeFlexibility {
label "Node Flexibility"
description
"Aims at shorter and straighter edges. Two configurations are possible:
(a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand),
(b) additionally allow to enlarge a node wherever it helps.
If this option is not configured for a node, the 'nodeFlexibility.default' value is used,
which is specified for the node's parent."
targets nodes
requires nodePlacement.strategy == NodePlacementStrategy.NETWORK_SIMPLEX
}
group nodeFlexibility {
advanced option ^default: NodeFlexibility {
label "Node Flexibility Default"
description
"Default value of the 'nodeFlexibility' option for the children of a hierarchical node."
default = NodeFlexibility.NONE
targets parents
requires nodePlacement.strategy == NodePlacementStrategy.NETWORK_SIMPLEX
}
}
}
}
/* ------------------------
* phase 5
* ------------------------*/
group edgeRouting {
group splines {
option mode: SplineRoutingMode {
label "Spline Routing Mode"
description
"Specifies the way control points are assembled for each individual edge.
CONSERVATIVE ensures that edges are properly routed around the nodes
but feels rather orthogonal at times.
SLOPPY uses fewer control points to obtain curvier edge routes but may result in
edges overlapping nodes. "
default = SplineRoutingMode.SLOPPY
targets parents
requires org.eclipse.elk.edgeRouting == EdgeRouting.SPLINES
}
group sloppy {
option layerSpacingFactor: double {
label "Sloppy Spline Layer Spacing Factor"
description
"Spacing factor for routing area between layers when using sloppy spline routing."
default = 0.2
targets parents
requires org.eclipse.elk.edgeRouting == EdgeRouting.SPLINES // TODO this should be an AND
requires splines.mode == SplineRoutingMode.SLOPPY
}
}
}
group polyline {
advanced option slopedEdgeZoneWidth: double {
label "Sloped Edge Zone Width"
description
"Width of the strip to the left and to the right of each layer where the polyline edge router
is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward
bend points for nodes that extent almost to the edge of their layer."
documentation "@slopedEdgeZoneWidth.md"
default = 2.0
targets parents
requires org.eclipse.elk.edgeRouting == EdgeRouting.POLYLINE
}
}
option selfLoopDistribution: SelfLoopDistributionStrategy {
label "Self-Loop Distribution"
description
"Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE."
default = SelfLoopDistributionStrategy.NORTH
targets nodes
}
option selfLoopOrdering: SelfLoopOrderingStrategy {
label "Self-Loop Ordering"
description
"Alter the ordering of the loops they can either be stacked or sequenced.
It only takes effect for PortConstraints.FREE."
default = SelfLoopOrderingStrategy.STACKED
targets nodes
}
}
/* ------------------------
* spacing
* ------------------------*/
group spacing {
option baseValue: double {
label "Spacing Base Value"
description
"An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently
alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout
options, this base value will have no effect. The base value is not inherited, i.e. it must be set for
each hierarchical node."
targets parents
lowerBound = 0.0
}
option edgeNodeBetweenLayers: double {
label "Edge Node Between Layers Spacing"
description
"The spacing to be preserved between nodes and edges that are routed next to the node's layer.
For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used."
default = 10
lowerBound = 0.0
targets parents
}
option edgeEdgeBetweenLayers: double {
label "Edge Edge Between Layer Spacing"
description
"Spacing to be preserved between pairs of edges that are routed between the same pair of layers.
Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer."
default = 10
lowerBound = 0.0
targets parents
}
option nodeNodeBetweenLayers: double {
label "Node Node Between Layers Spacing"
description
"The spacing to be preserved between any pair of nodes of two adjacent layers.
Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself."
default = 20
lowerBound = 0.0
targets parents
}
}
/* ------------------------
* priority
* ------------------------*/
group priority {
advanced option direction: int {
label "Direction Priority"
description
"Defines how important it is to have a certain edge point into the direction of the overall layout.
This option is evaluated during the cycle breaking phase."
default = 0
lowerBound = 0
targets edges
}
advanced option shortness: int {
label "Shortness Priority"
description
"Defines how important it is to keep an edge as short as possible.
This option is evaluated during the layering phase."
default = 0
lowerBound = 0
targets edges
}
advanced option straightness: int {
label "Straightness Priority"
description
"Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes.
This option is evaluated during node placement."
default = 0
lowerBound = 0
targets edges
}
}
/* ------------------------
* compaction
* ------------------------*/
group compaction {
group postCompaction {
advanced option strategy: GraphCompactionStrategy {
label "Post Compaction Strategy"
description
"Specifies whether and how post-process compaction is applied."
default = GraphCompactionStrategy.NONE
targets parents
}
advanced option constraints: ConstraintCalculationStrategy {
label "Post Compaction Constraint Calculation"
description
"Specifies whether and how post-process compaction is applied."
default = ConstraintCalculationStrategy.SCANLINE
targets parents
}
}
advanced option connectedComponents: boolean {
label "Connected Components Compaction"
description
"Tries to further compact components (disconnected sub-graphs)."
default = false
targets parents
requires org.eclipse.elk.separateConnectedComponents == true
}
}
/* ------------------------
* high degree nodes
* ------------------------*/
group highDegreeNodes {
advanced option treatment: boolean {
label "High Degree Node Treatment"
description
"Makes room around high degree nodes to place leafs and trees."
default = false
targets parents
}
advanced option threshold: int {
label "High Degree Node Threshold"
description
"Whether a node is considered to have a high degree."
default = 16
lowerBound = 0
targets parents
requires org.eclipse.elk.alg.layered.highDegreeNodes.treatment == true
}
advanced option treeHeight: int {
label "High Degree Node Maximum Tree Height"
description
"Maximum height of a subtree connected to a high degree node to be moved to separate layers."
default = 5
lowerBound = 0
targets parents
requires org.eclipse.elk.alg.layered.highDegreeNodes.treatment == true
}
}
/* ------------------------
* wrapping
* ------------------------*/
group wrapping {
advanced option strategy: WrappingStrategy {
label "Graph Wrapping Strategy"
description
"For certain graphs and certain prescribed drawing areas it may be desirable to
split the laid out graph into chunks that are placed side by side.
The edges that connect different chunks are 'wrapped' around from the end of
one chunk to the start of the other chunk.
The points between the chunks are referred to as 'cuts'."
targets parents
default = WrappingStrategy.OFF
}
advanced option additionalEdgeSpacing: double {
label "Additional Wrapped Edges Spacing"
description
"To visually separate edges that are wrapped from regularly routed edges an additional spacing value
can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing."
default = 10
targets parents
requires wrapping.strategy == WrappingStrategy.SINGLE_EDGE
requires wrapping.strategy == WrappingStrategy.MULTI_EDGE
}
advanced option correctionFactor: double {
label "Correction Factor for Wrapping"
description
"At times and for certain types of graphs the executed wrapping may produce results that
are consistently biased in the same fashion: either wrapping to often or to rarely.
This factor can be used to correct the bias. Internally, it is simply multiplied with
the 'aspect ratio' layout option."
default = 1.0
targets parents
requires wrapping.strategy == WrappingStrategy.SINGLE_EDGE
requires wrapping.strategy == WrappingStrategy.MULTI_EDGE
}
group cutting {
advanced option strategy: CuttingStrategy {
label "Cutting Strategy"
description
"The strategy by which the layer indexes are determined at which the layering crumbles into chunks."
default = CuttingStrategy.MSD
targets parents
requires wrapping.strategy == WrappingStrategy.SINGLE_EDGE
requires wrapping.strategy == WrappingStrategy.MULTI_EDGE
}
advanced option cuts: List<Integer> {
label "Manually Specified Cuts"
description
"Allows the user to specify her own cuts for a certain graph."
targets parents
requires wrapping.cutting.strategy == CuttingStrategy.MANUAL
}
group msd {
advanced option freedom: Integer {
label "MSD Freedom"
description
"The MSD cutting strategy starts with an initial guess on the number of chunks the graph
should be split into. The freedom specifies how much the strategy may deviate from this guess.
E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts."
default = 1
lowerBound = 0
targets parents
requires wrapping.cutting.strategy == CuttingStrategy.MSD
}
}
}
group validify {
advanced option strategy: ValidifyStrategy {
label "Validification Strategy"
description
"When wrapping graphs, one can specify indices that are not allowed as split points.
The validification strategy makes sure every computed split point is allowed."
default = ValidifyStrategy.GREEDY
targets parents
requires wrapping.strategy == WrappingStrategy.SINGLE_EDGE
requires wrapping.strategy == WrappingStrategy.MULTI_EDGE
}
advanced option forbiddenIndices: List<Integer> {
label "Valid Indices for Wrapping"
targets parents
requires wrapping.strategy == WrappingStrategy.SINGLE_EDGE
requires wrapping.strategy == WrappingStrategy.MULTI_EDGE
}
}
group singleEdge {
}
group multiEdge {
advanced option improveCuts: boolean {
label "Improve Cuts"
description
"For general graphs it is important that not too many edges wrap backwards.
Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought."
default = true
targets parents
requires strategy == WrappingStrategy.MULTI_EDGE
}
advanced option distancePenalty: double {
label "Distance Penalty When Improving Cuts "
default = 2.0
targets parents
requires strategy == WrappingStrategy.MULTI_EDGE
requires improveCuts == true
}
advanced option improveWrappedEdges: boolean {
label "Improve Wrapped Edges"
description
"The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from
one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges."
default = true
targets parents
requires strategy == WrappingStrategy.MULTI_EDGE
}
}
}
/* ------------------------
* edgeLabels
* ------------------------*/
group edgeLabels {
option sideSelection: EdgeLabelSideSelection {
label "Edge Label Side Selection"
description
"Method to decide on edge label sides."
default = EdgeLabelSideSelection.SMART_DOWN
targets parents
}
advanced option centerLabelPlacementStrategy: CenterEdgeLabelPlacementStrategy {
label "Edge Center Label Placement Strategy"
description
"Determines in which layer center labels of long edges should be placed."
default = CenterEdgeLabelPlacementStrategy.MEDIAN_LAYER
targets parents, labels
}
}
/* ------------------------
* miscellaneous
* ------------------------*/
group considerModelOrder {
option strategy: OrderingStrategy {
label "Consider Model Order"
description
"Preserves the order of nodes and edges in the model file if this does not lead to additional edge
crossings. Depending on the strategy this is not always possible since the node and edge order might be
conflicting."
default = OrderingStrategy.NONE
targets parents
}
option noModelOrder: boolean {
label "No Model Order"
description
"Set on a node to not set a model order for this node even though it is a real node."
default = false
targets nodes
}
option components: ComponentOrderingStrategy {
label "Consider Model Order for Components"
description
"If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used.
INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side.
FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub
optimal drawings in terms of used area since the ordering should be respected."
targets parents
default = ComponentOrderingStrategy.NONE
requires org.eclipse.elk.separateConnectedComponents
}
option longEdgeStrategy: LongEdgeOrderingStrategy {
label "Long Edge Ordering Strategy"
description
"Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a
previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a
vertical layout."
default = LongEdgeOrderingStrategy.DUMMY_NODE_OVER
targets parents
}
option crossingCounterNodeInfluence: double {
label "Crossing Counter Node Order Influence"
description
"Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the
crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing.
This allows some edge crossings in favor of preserving the model order. It is advised to set this value to
a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no
influence (0)."
default = 0
targets parents
requires org.eclipse.elk.alg.layered.considerModelOrder.strategy
}
option crossingCounterPortInfluence: double {
label "Crossing Counter Port Order Influence"
description
"Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the
crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing.
This allows some edge crossings in favor of preserving the model order. It is advised to set this value to
a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no
influence (0)."
default = 0
targets parents
requires org.eclipse.elk.alg.layered.considerModelOrder.strategy
}
}
advanced option directionCongruency: DirectionCongruency {
label "Direction Congruency"
description