Changes for page KIML Layout Options

Last modified by Alexander Schulz-Rosengarten on 2023/09/11 16:17

From version 20.1
edited by msp
on 2014/03/08 20:42
Change comment: There is no comment for this version
To version 30.1
edited by csp
on 2015/02/18 12:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.msp
1 +XWiki.csp
Content
... ... @@ -35,7 +35,7 @@
35 35  Default
36 36  )))
37 37  |(((
38 -Alignment
38 +[[Alignment>>doc:||anchor="alignment"]]
39 39  )))|(((
40 40  de.cau.cs.kieler.alignment
41 41  )))|(((
... ... @@ -46,7 +46,7 @@
46 46  AUTOMATIC
47 47  )))
48 48  |(((
49 -Aspect Ratio
49 +[[Aspect Ratio>>doc:||anchor="aspectRatio"]]
50 50  )))|(((
51 51  de.cau.cs.kieler.aspectRatio
52 52  )))|(((
... ... @@ -146,7 +146,7 @@
146 146  
147 147  )))
148 148  |(((
149 -Layout Hierarchy
149 +[[Layout Hierarchy>>doc:||anchor="layoutHierarchy"]]
150 150  )))|(((
151 151  de.cau.cs.kieler.layoutHierarchy
152 152  )))|(((
... ... @@ -179,6 +179,7 @@
179 179  )))|(% colspan="1" %)(% colspan="1" %)
180 180  (((
181 181  Nodes
182 +Labels
182 182  )))|(% colspan="1" %)(% colspan="1" %)
183 183  (((
184 184  
... ... @@ -212,7 +212,7 @@
212 212  )))
213 213  |(% colspan="1" %)(% colspan="1" %)
214 214  (((
215 -Port Spacing
216 +
216 216  )))|(% colspan="1" %)(% colspan="1" %)
217 217  (((
218 218  de.cau.cs.kieler.portSpacing
... ... @@ -226,6 +226,91 @@
226 226  (((
227 227  
228 228  )))
230 +|(% colspan="1" %)(% colspan="1" %)
231 +(((
232 +Port Alignment
233 +)))|(% colspan="1" %)(% colspan="1" %)
234 +(((
235 +de.cau.cs.kieler.portAlignment
236 +)))|(% colspan="1" %)(% colspan="1" %)
237 +(((
238 +Enum
239 +)))|(% colspan="1" %)(% colspan="1" %)
240 +(((
241 +Nodes
242 +Parents
243 +)))|(% colspan="1" %)(% colspan="1" %)
244 +(((
245 +JUSTIFIED
246 +)))
247 +|(% colspan="1" %)(% colspan="1" %)
248 +(((
249 +Port Alignment for Northern Ports
250 +)))|(% colspan="1" %)(% colspan="1" %)
251 +(((
252 +de.cau.cs.kieler.portAlignment.north
253 +)))|(% colspan="1" %)(% colspan="1" %)
254 +(((
255 +Enum
256 +)))|(% colspan="1" %)(% colspan="1" %)
257 +(((
258 +Nodes
259 +Parents
260 +)))|(% colspan="1" %)(% colspan="1" %)
261 +(((
262 +UNDEFINED
263 +)))
264 +|(% colspan="1" %)(% colspan="1" %)
265 +(((
266 +Port Alignment for Souther Ports
267 +)))|(% colspan="1" %)(% colspan="1" %)
268 +(((
269 +de.cau.cs.kieler.portAlignment.south
270 +)))|(% colspan="1" %)(% colspan="1" %)
271 +(((
272 +Enum
273 +)))|(% colspan="1" %)(% colspan="1" %)
274 +(((
275 +Nodes
276 +Parents
277 +)))|(% colspan="1" %)(% colspan="1" %)
278 +(((
279 +UNDEFINED
280 +)))
281 +|(% colspan="1" %)(% colspan="1" %)
282 +(((
283 +Port Alignment for Eastern Ports
284 +)))|(% colspan="1" %)(% colspan="1" %)
285 +(((
286 +de.cau.cs.kieler.portAlignment.east
287 +)))|(% colspan="1" %)(% colspan="1" %)
288 +(((
289 +Enum
290 +)))|(% colspan="1" %)(% colspan="1" %)
291 +(((
292 +Nodes
293 +Parents
294 +)))|(% colspan="1" %)(% colspan="1" %)
295 +(((
296 +UNDEFINED
297 +)))
298 +|(% colspan="1" %)(% colspan="1" %)
299 +(((
300 +Port Alignment for Western Ports
301 +)))|(% colspan="1" %)(% colspan="1" %)
302 +(((
303 +de.cau.cs.kieler.portAlignment.west
304 +)))|(% colspan="1" %)(% colspan="1" %)
305 +(((
306 +Enum
307 +)))|(% colspan="1" %)(% colspan="1" %)
308 +(((
309 +Nodes
310 +Parents
311 +)))|(% colspan="1" %)(% colspan="1" %)
312 +(((
313 +UNDEFINED
314 +)))
229 229  |(((
230 230  Position
231 231  )))|(((
... ... @@ -349,6 +349,22 @@
349 349  )))
350 350  |(% colspan="1" %)(% colspan="1" %)
351 351  (((
438 +[[Additional Port Space>>doc:||anchor="addPortSpace"]]
439 +)))|(% colspan="1" %)(% colspan="1" %)
440 +(((
441 +de.cau.cs.kieler.additionalPortSpace
442 +)))|(% colspan="1" %)(% colspan="1" %)
443 +(((
444 +Margins
445 +)))|(% colspan="1" %)(% colspan="1" %)
446 +(((
447 +Nodes
448 +)))|(% colspan="1" %)(% colspan="1" %)
449 +(((
450 +0, 0, 0, 0
451 +)))
452 +|(% colspan="1" %)(% colspan="1" %)
453 +(((
352 352  Animate
353 353  )))|(% colspan="1" %)(% colspan="1" %)
354 354  (((
... ... @@ -381,7 +381,7 @@
381 381  )))
382 382  |(% colspan="1" %)(% colspan="1" %)
383 383  (((
384 -Comment Box
486 +[[Comment Box>>doc:||anchor="commentBox"]]
385 385  )))|(% colspan="1" %)(% colspan="1" %)
386 386  (((
387 387  de.cau.cs.kieler.commentBox
... ... @@ -467,7 +467,7 @@
467 467  )))
468 468  |(% colspan="1" %)(% colspan="1" %)
469 469  (((
470 -Hypernode
572 +[[Hypernode>>doc:||anchor="hypernode"]]
471 471  )))|(% colspan="1" %)(% colspan="1" %)
472 472  (((
473 473  de.cau.cs.kieler.hypernode
... ... @@ -565,7 +565,7 @@
565 565  )))
566 566  |(% colspan="1" %)(% colspan="1" %)
567 567  (((
568 -No Layout
670 +[[No Layout>>doc:||anchor="noLayout"]]
569 569  )))|(% colspan="1" %)(% colspan="1" %)
570 570  (((
571 571  de.cau.cs.kieler.noLayout
... ... @@ -581,6 +581,22 @@
581 581  )))
582 582  |(% colspan="1" %)(% colspan="1" %)
583 583  (((
686 +[[Port Anchor Offset>>doc:||anchor="portAnchor"]]
687 +)))|(% colspan="1" %)(% colspan="1" %)
688 +(((
689 +de.cau.cs.kieler.klay.layered.portAnchor
690 +)))|(% colspan="1" %)(% colspan="1" %)
691 +(((
692 +Object
693 +)))|(% colspan="1" %)(% colspan="1" %)
694 +(((
695 +Ports
696 +)))|(% colspan="1" %)(% colspan="1" %)
697 +(((
698 +
699 +)))
700 +|(% colspan="1" %)(% colspan="1" %)
701 +(((
584 584  Port Index
585 585  )))|(% colspan="1" %)(% colspan="1" %)
586 586  (((
... ... @@ -661,6 +661,22 @@
661 661  )))
662 662  |(% colspan="1" %)(% colspan="1" %)
663 663  (((
782 +Thickness
783 +)))|(% colspan="1" %)(% colspan="1" %)
784 +(((
785 +de.cau.cs.kieler.thickness
786 +)))|(% colspan="1" %)(% colspan="1" %)
787 +(((
788 +Float
789 +)))|(% colspan="1" %)(% colspan="1" %)
790 +(((
791 +Edges
792 +)))|(% colspan="1" %)(% colspan="1" %)
793 +(((
794 +1.0
795 +)))
796 +|(% colspan="1" %)(% colspan="1" %)
797 +(((
664 664  Zoom to Fit
665 665  )))|(% colspan="1" %)(% colspan="1" %)
666 666  (((
... ... @@ -712,21 +712,21 @@
712 712  
713 713  = Detailed Documentation =
714 714  
849 +This section explains every layout option in more detail.
850 +
715 715  == The Most Important Options ==
716 716  
717 717  While most layout options are used to affect how the active layout algorithm computes concrete coordinates for the graph elements, there are some layout options that have a special role in KIML.
718 718  
719 -=== Layout Algorithm ===
855 +=== ===
720 720  
721 -{{id name="layoutAlgorithm"/}}
857 +{{id name="layoutAlgorithm"/}}Layout AlgorithmThe option with identifier {{code language="none"}}de.cau.cs.kieler.algorithm{{/code}} specifies which layout algorithm to use for a graph or subgraph. The value can be either the identifier of a layout algorithm or the identifier of a layout type. In the latter case the algorithm with highest priority of that type is applied. It is possible to set different values for this option on subgraphs of a hierarchical graph, where a subgraph is identified by a parent node. A layout algorithm is responsible to process only the direct content of a given parent node. An exception from this rule is made when the [[Layout Hierarchy>>doc:||anchor="layoutHierarchy"]] option is active.
722 722  
723 -The option with identifier {{code language="none"}}de.cau.cs.kieler.algorithm{{/code}} specifies which layout algorithm to use for a graph or subgraph. The value can be either the identifier of a layout algorithm or the identifier of a layout type. In the latter case the algorithm with highest priority of that type is applied. It is possible to set different values for this option on subgraphs of a hierarchical graph, where a subgraph is identified by a parent node. A layout algorithm is responsible to process only the direct content of a given parent node. An exception from this rule is made when the Layout Hierarchy option is active.
724 -
725 725  The following layout has been created by setting a force-based layout algorithm on the inner hierarchy level and a layer-based layout algorithm on the top level.
726 726  
727 727  [[image:attach:layout_algorithm.png]]
728 728  
729 -=== Available Algorithms and Libraries ===
863 +==== Available Algorithms and Libraries ====
730 730  
731 731  * **The [[KLay Project>>doc:Layout Algorithms (KLay)]]** - Java implementations of standard layout approaches, augmented with special processing of graph features such as ports and labels.
732 732  * **Randomizer** - Distributes the nodes randomly; not very useful, but it can show how important a good layout is for understanding a graph.
... ... @@ -737,7 +737,7 @@
737 737  * **OGDF** ((% style="color: rgb(0,0,0);" %)[[www.ogdf.net>>url:http://www.ogdf.net/||shape="rect"]](%%)) - A self-contained C++ class library for the automatic layout of diagrams. The version that is shipped with KIELER is compiled as an executable that reads files in OGML format and outputs the computed concrete layout.
738 738  * **Graphviz** ([[www.graphviz.org>>url:http://www.graphviz.org/||shape="rect"]]) - An open source graph visualization tool with several graph layout programs, web and interactive graphical interfaces, auxiliary tools, libraries, and language bindings. Graphviz needs to be installed separately in order to be used within KIELER, since it is called in a separate process using the DOT language for communication.
739 739  
740 -=== Predefined Layout Types ===
874 +==== Predefined Layout Types ====
741 741  
742 742  * **Layered** - The layer-based method emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.
743 743  * **Orthogonal** - Orthogonal methods follow the "topology-shape-metrics" approach, which first applies a planarization technique, resulting in a planar representation of the graph, then compute an orthogonal shape, and finally determine concrete coordinates for nodes and edge bend points by applying a compaction method.
... ... @@ -745,12 +745,10 @@
745 745  * **Circular** - Circular layout algorithms emphasize biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent properties of the graph.
746 746  * **Tree** - Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type.
747 747  
748 -=== Diagram Type ===
882 +=== ===
749 749  
750 -{{id name="diagramType"/}}
884 +{{id name="diagramType"/}}Diagram TypeDiagram types are used to classify graphical diagrams for setting default layout option values for a set of similar diagrams. The diagram type of an element is specified with the layout option {{code language="none"}}de.cau.cs.kieler.diagramType{{/code}}. Layout algorithms can declare which diagram types they support well, and give a priority value for each supported type. KIML decides at runtime which layout algorithm has the highest priority for a given diagram, so that the most suitable algorithm is always used. Usual values for such priorities are between 1 and 10, where the highest value should only be assigned if the algorithm is especially designed for diagrams of the respective type, or if it has proven to be very adequate for them. Lower values should be given if the algorithm is able to draw the diagrams correctly, but with lower quality of the resulting layout.
751 751  
752 -Diagram types are used to classify graphical diagrams for setting default layout option values for a set of similar diagrams. The diagram type of an element is specified with the layout option {{code language="none"}}de.cau.cs.kieler.diagramType{{/code}}. Layout algorithms can declare which diagram types they support well, and give a priority value for each supported type. KIML decides at runtime which layout algorithm has the highest priority for a given diagram, so that the most suitable algorithm is always used. Usual values for such priorities are between 1 and 10, where the highest value should only be assigned if the algorithm is especially designed for diagrams of the respective type, or if it has proven to be very adequate for them. Lower values should be given if the algorithm is able to draw the diagrams correctly, but with lower quality of the resulting layout.
753 -
754 754  The following diagram types are predefined:
755 755  
756 756  * **General** - This type is automatically assigned to all diagrams for which no specific type is declared. A layout algorithm that has the highest priority on the //General// diagram type is taken as the default algorithm when no further information on a diagram is available to KIML.
... ... @@ -760,39 +760,86 @@
760 760  * **Use Case Diagram** - Use case diagrams as defined by the UML.
761 761  * **Unconnected Boxes** - Sets of nodes that have no connections and are treated as resizable boxes. This is related to mathematical [[packing problems>>url:http://en.wikipedia.org/wiki/Packing_problem||shape="rect"]]. Example: Regions in [[doc:SCCharts SyncCharts]].
762 762  
895 +=== ===
896 +
897 +{{id name="edgeRouting"/}}Edge RoutingThis option influences the way in which edges are routed between the nodes they connect. The following settings are available:
898 +
899 +* POLYLINE
900 +Edges consist of one or more segments defined by a list of bend points.
901 +* ORTHOGONAL
902 +Edges are routed orthogonally, meaning that each segment of an edge runs either horizontally or vertically.
903 +* SPLINES
904 +Edges are routed as splines (smooth curves).
905 +* UNDEFINED
906 +No particular edge routing style is selected. Usually this value points to the default setting of the selected layout algorithm.
907 +
908 +[[image:attach:edge_routing.png]]
909 +
910 +When used as layout option, the edge routing is set for a whole graph or subgraph, i.e. on a parent node. However, the property is additionally used for the output of the layout algorithm in order to mark individual edges. If the edge routing assigned to an edge is anything other than SPLINES, the bend points of that edge are interpreted with their normal meaning, i.e. straight lines are drawn between consecutive bend points. If, on the other hand, a layout algorithm marks an edge with the value SPLINES, the bend points have to be interpreted as control points for a series of cubic splines following this procedure:
911 +
912 +1. Start at the source point of the edge.
913 +1. As long as there are at least three bend points left:
914 +11. Draw a cubic spline segment to the third bend point with the other two bend points as control points.
915 +11. Use the third bend point as start point for the next segment.
916 +11. Consume the three bend points and proceed to the next segment.
917 +1. Check the number of remaining bend points:
918 +11. Two bend points – draw a cubic spline segment to the target point of the edge.
919 +11. One bend point – draw a quadratic spline segment to the target point of the edge.
920 +11. No bend point – draw a straight line to the target point of the edge.
921 +
763 763  == Other Options ==
764 764  
765 -* **Layout Hierarchy** ({{code language="none"}}de.cau.cs.kieler.layoutHierarchy{{/code}}) - If this option is supported and active, the layout algorithm is requested to process the full hierarchy contained in the input node. This means that instead of executing another algorithm on each hierarchy level, all levels are arranged in a single algorithm execution.
766 -* **Hypernode** ({{code language="none"}}de.cau.cs.kieler.hypernode{{/code}}) - A node that is marked as hypernode has a special role in the graph structure, since all its incident edges are treated as parts of the same [[hyperedge>>url:http://en.wikipedia.org/wiki/Hypergraph||shape="rect"]]. Example: relation vertices in [[Ptolemy>>url:http://ptolemy.eecs.berkeley.edu/||shape="rect"]] models.
767 -* **Comment Box** ({{code language="none"}}de.cau.cs.kieler.commentBox{{/code}}) - A node that is marked as comment box is treated as a label that needs to be placed somewhere. This is different to normal node labels, which are usually regarded as fixed.
768 -* **No Layout** ({{code language="none"}}de.cau.cs.kieler.noLayout{{/code}}) - Elements that are marked with this option are excluded from layout. This is used to identify diagram objects that should not be regarded as graph elements.
924 +=== ===
769 769  
770 -This section explains every layout option in more detail.
926 +{{id name="addPortSpace"/}}Additional Port SpaceThis option controls additional port space left around the set of ports on each side:
771 771  
772 -=== Edge Routing ===
928 +[[image:attach:addPortSpace.png]]
773 773  
774 -{{id name="edgeRouting"/}}
930 +This option is only relevant if port constraints are {{code language="none"}}FREE{{/code}}, {{code language="none"}}FIXED_SIDE{{/code}}, or {{code language="none"}}FIXED_ORDER{{/code}}. If size constraints include {{code language="none"}}PORTS{{/code}}, the additional port space, together with the port spacing and the size of ports, determines a lower bound on the node size.
775 775  
776 -This option influences the way in which edges are routed between the nodes they connect. The following settings are available:
932 +=== ===
777 777  
778 -* POLYLINE
779 -Edges consist of one or more segments defined by a list of bend points.
780 -* ORTHOGONAL
781 -Edges are routed orthogonally, meaning that each segment of an edge runs either horizontally or vertically, but never at an angle.
782 -* SPLINE
783 -Edges are routed as splines (smooth curves). (% style="color: rgb(153,51,0);" %)**TODO:** Add more documentation on how the returned bend points are to be interpreted.
784 -* UNDEFINED
785 -No particular edge routing style is selected. The result produced by the layout algorithm may be undefined.
934 +{{id name="alignment"/}}AlignmentDetermines the alignment of a node in relation to other nodes of the same row or column. For layer-based algorithms, for instance, this option controls how a node is positioned inside its assigned layer.
786 786  
787 -(% style="color: rgb(153,51,0);" %)**TODO:** Add an image illustrating the different routing styles.
936 +=== ===
788 788  
789 -=== Port Offset ===
938 +{{id name="aspectRatio"/}}Aspect RatioThe aspect ratio of a drawing is the ratio of its total width to its total height. This option gives some control over that ratio, although in most cases it is only interpreted as a hint on how to arrange multiple connected components, hence the actual aspect ratio will probably be different from what has been specified with the option.
790 790  
791 -{{id name="portOffset"/}}
940 +=== ===
792 792  
793 -The port offset is used to specify how much space a layout algorithm should leave between a port and the border of its node. This is usually zero, but doesn't have to be. If the offset is not defined for a given port, a layout algorithm can try to infer the offset from the port's coordinates and its node's size in the input graph. This of course requires both properties to be set to sensible values.
942 +{{id name="commentBox"/}}Comment BoxA node that is marked as comment box is treated as a label that needs to be placed somewhere. In contrast to normal node labels (modeled with a KLabel instance), comment boxes may have connections to other nodes, as in the following example.
794 794  
944 +[[image:attach:comment_box.png]]
945 +
946 +=== ===
947 +
948 +{{id name="hypernode"/}}HypernodeA node that is marked as hypernode has a special role in the graph structure, since all its incident edges are treated as parts of the same [[hyperedge>>url:http://en.wikipedia.org/wiki/Hypergraph||shape="rect"]]. Example: relation vertices in [[Ptolemy>>url:http://ptolemy.eecs.berkeley.edu/||shape="rect"]] models.
949 +
950 +=== ===
951 +
952 +{{id name="layoutHierarchy"/}}Layout HierarchyIf this option is supported and active, the layout algorithm is requested to process the full hierarchy contained in the input node. This means that instead of executing another algorithm on each hierarchy level, all levels are arranged in a single algorithm execution.
953 +
954 +=== ===
955 +
956 +{{id name="noLayout"/}}No LayoutElements that are marked with this option are excluded from layout. This is used to identify diagram objects that should not be regarded as graph elements.
957 +
958 +=== ===
959 +
960 +{{id name="portAnchor"/}}Port Anchor OffsetSince ports have a size, we need a concrete point inside the port that edges should start or end in. In KLay Layered, this is referred to as the //port anchor//. By default, the center of each port is used as its port anchor, but this behavior can be overridden by setting an explicit port anchor.
961 +
962 +In the following example, the port anchor of the left port was moved upwards, while the port anchor of the second port was moved downwards:
963 +
964 +[[image:attach:KLay Layered Layout Options@port_anchors.png]]
965 +
966 +=== ===
967 +
968 +{{id name="portOffset"/}}Port OffsetThe port offset is used to specify how much space a layout algorithm should leave between a port and the border of its node. This is usually zero, but doesn't have to be. If the offset is not defined for a given port, a layout algorithm can try to infer the offset from the port's coordinates and its node's size in the input graph. This of course requires both properties to be set to sensible values.
969 +
795 795  Set this property if one of the following cases applies:
796 796  
797 797  * The port constraints on a node are set to FREE, FIXED_SIDES or FIXED_ORDER.
798 798  * The port constraints on a node are set to FIXED_RATIO or FIXED_POS, and the size of the node is not fixed. (Note that this is especially true for ports of compound nodes.)
974 +
975 +=== ===
976 +
977 +{{id name="portSpacing"/}}Port SpacingThe port spacing determines how much space KLay Layered should leave between the ports of each side. This option is only relevant if the node size depends on the ports, that is, if the size constraints include {{code language="none"}}SizeConstraint.PORTS{{/code}}.
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -9470014
1 +10751222
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/9470014/KIML Layout Options
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/10751222/KIML Layout Options