Changes for page KIML Layout Options

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

From version 2.1
edited by cds
on 2013/05/31 20:06
Change comment: There is no comment for this version
To version 17.1
edited by msp
on 2014/03/07 16:46
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Layout Options
1 +KIML Layout Options
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.cds
1 +XWiki.msp
Content
... ... @@ -1,8 +1,8 @@
1 1  {{warning}}
2 -This is preliminary documentation. You've been warned.
2 +This is preliminary and incomplete documentation. You've been warned.
3 3  {{/warning}}
4 4  
5 -KIML defines a whole set of standard layout options that many layout algorithms support. Whether an algorithm supports a layout option depends on the option and on the algorithm. Algorithms may provide more specialized documentation for a given layout option.
5 +KIML defines a whole set of standard layout options that many layout algorithms support. Whether an algorithm supports a layout option depends on the option and on the algorithm. When an option is supported by an algorithm, it may change the option's default value. Algorithms may also provide more specialized documentation for a given layout option.
6 6  
7 7  **Contents**
8 8  
... ... @@ -16,7 +16,7 @@
16 16  
17 17  * An ID to identify them.
18 18  * A type. One of Boolean, String, Int, Float, Enum, EnumSet (a {{code language="none"}}Set{{/code}} over a given enumeration), or Object. The types Enum and EnumSet have to be further defined by an enumeration class. The Object type can be constricted to a certain class.
19 -* An optional definition of what kinds of graph objects the option applies to. At least one of Parents (nodes that have children, including the diagram root node), Nodes, Edges, Ports, and Labels. If this definition is omitted, a layout option will not be shown to the user in the UI, but can still be set programmatically.
19 +* The kinds of graph objects the option applies to. At least one of Parents (nodes that have children, including the diagram root node), Nodes, Edges, Ports, and Labels.
20 20  * An optional default value. If an option is not set on an object and if the option does not have a default value, {{code language="none"}}null{{/code}} is returned when it is accessed.
21 21  
22 22  KIML defines the following set of layout options:
... ... @@ -74,7 +74,7 @@
74 74  )))|(((
75 75  Parents
76 76  )))|(((
77 --1.0
77 +
78 78  )))
79 79  |(% colspan="1" %)(% colspan="1" %)
80 80  (((
... ... @@ -87,7 +87,7 @@
87 87  Boolean
88 88  )))|(% colspan="1" %)(% colspan="1" %)
89 89  (((
90 -
90 +Nodes
91 91  )))|(% colspan="1" %)(% colspan="1" %)
92 92  (((
93 93  false
... ... @@ -105,7 +105,7 @@
105 105  )))
106 106  |(% colspan="1" %)(% colspan="1" %)
107 107  (((
108 -Diagram Type
108 +[[Diagram Type>>doc:||anchor="diagramType"]]
109 109  )))|(% colspan="1" %)(% colspan="1" %)
110 110  (((
111 111  de.cau.cs.kieler.diagramType
... ... @@ -128,7 +128,7 @@
128 128  )))|(((
129 129  Parents
130 130  )))|(((
131 -UNDEFINED
131 +
132 132  )))
133 133  |(% colspan="1" %)(% colspan="1" %)
134 134  (((
... ... @@ -141,13 +141,13 @@
141 141  Enum
142 142  )))|(% colspan="1" %)(% colspan="1" %)
143 143  (((
144 -
144 +Labels
145 145  )))|(% colspan="1" %)(% colspan="1" %)
146 146  (((
147 -UNDEFINED
147 +
148 148  )))
149 149  |(((
150 -Edge Routing
150 +[[Edge Routing>>doc:||anchor="edgeRouting"]]
151 151  )))|(((
152 152  de.cau.cs.kieler.edgeRouting
153 153  )))|(((
... ... @@ -155,7 +155,7 @@
155 155  )))|(((
156 156  Parents
157 157  )))|(((
158 -UNDEFINED
158 +
159 159  )))
160 160  |(% colspan="1" %)(% colspan="1" %)
161 161  (((
... ... @@ -168,7 +168,7 @@
168 168  Enum
169 169  )))|(% colspan="1" %)(% colspan="1" %)
170 170  (((
171 -
171 +Edges
172 172  )))|(% colspan="1" %)(% colspan="1" %)
173 173  (((
174 174  NONE
... ... @@ -195,7 +195,7 @@
195 195  String
196 196  )))|(% colspan="1" %)(% colspan="1" %)
197 197  (((
198 -
198 +Labels
199 199  )))|(% colspan="1" %)(% colspan="1" %)
200 200  (((
201 201  
... ... @@ -211,7 +211,7 @@
211 211  Int
212 212  )))|(% colspan="1" %)(% colspan="1" %)
213 213  (((
214 -
214 +Labels
215 215  )))|(% colspan="1" %)(% colspan="1" %)
216 216  (((
217 217  
... ... @@ -227,7 +227,7 @@
227 227  Boolean
228 228  )))|(% colspan="1" %)(% colspan="1" %)
229 229  (((
230 -
230 +Nodes
231 231  )))|(% colspan="1" %)(% colspan="1" %)
232 232  (((
233 233  false
... ... @@ -253,7 +253,7 @@
253 253  Edges
254 254  Nodes
255 255  )))|(((
256 --1.0
256 +
257 257  )))
258 258  |(((
259 259  Layout Hierarchy
... ... @@ -267,7 +267,7 @@
267 267  false
268 268  )))
269 269  |(((
270 -Layout Algorithm
270 +[[Layout Algorithm>>doc:||anchor="layoutAlgorithm"]]
271 271  )))|(((
272 272  de.cau.cs.kieler.algorithm
273 273  )))|(((
... ... @@ -288,7 +288,8 @@
288 288  Float
289 289  )))|(% colspan="1" %)(% colspan="1" %)
290 290  (((
291 -
291 +Nodes
292 +Parents
292 292  )))|(% colspan="1" %)(% colspan="1" %)
293 293  (((
294 294  0.0
... ... @@ -304,7 +304,8 @@
304 304  Float
305 305  )))|(% colspan="1" %)(% colspan="1" %)
306 306  (((
307 -
308 +Nodes
309 +Parents
308 308  )))|(% colspan="1" %)(% colspan="1" %)
309 309  (((
310 310  0.0
... ... @@ -350,7 +350,7 @@
350 350  )))|(((
351 351  Nodes
352 352  )))|(((
353 -UNDEFINED
355 +
354 354  )))
355 355  |(% colspan="1" %)(% colspan="1" %)
356 356  (((
... ... @@ -370,7 +370,7 @@
370 370  )))
371 371  |(% colspan="1" %)(% colspan="1" %)
372 372  (((
373 -Port Offset
375 +[[Port Offset>>doc:||anchor="portOffset"]]
374 374  )))|(% colspan="1" %)(% colspan="1" %)
375 375  (((
376 376  de.cau.cs.kieler.offset
... ... @@ -379,7 +379,7 @@
379 379  Float
380 380  )))|(% colspan="1" %)(% colspan="1" %)
381 381  (((
382 -
384 +Ports
383 383  )))|(% colspan="1" %)(% colspan="1" %)
384 384  (((
385 385  
... ... @@ -395,10 +395,26 @@
395 395  Enum
396 396  )))|(% colspan="1" %)(% colspan="1" %)
397 397  (((
400 +Ports
401 +)))|(% colspan="1" %)(% colspan="1" %)
402 +(((
398 398  
404 +)))
405 +|(% colspan="1" %)(% colspan="1" %)
406 +(((
407 +Port Spacing
399 399  )))|(% colspan="1" %)(% colspan="1" %)
400 400  (((
401 -UNDEFINED
410 +de.cau.cs.kieler.portSpacing
411 +)))|(% colspan="1" %)(% colspan="1" %)
412 +(((
413 +Float
414 +)))|(% colspan="1" %)(% colspan="1" %)
415 +(((
416 +Nodes
417 +)))|(% colspan="1" %)(% colspan="1" %)
418 +(((
419 +
402 402  )))
403 403  |(((
404 404  Position
... ... @@ -503,17 +503,88 @@
503 503  Parents
504 504  )))|(% colspan="1" %)(% colspan="1" %)
505 505  (((
506 --1.0
524 +
507 507  )))
508 508  
509 509  = The Most Important Options =
510 510  
511 -**TODO:** Write a bit of documentation about the most important layout options and how to use them, possibly with a simple example or something.
529 +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.
512 512  
531 +== Layout Algorithm ==
532 +
533 +{{id name="layoutAlgorithm"/}}
534 +
535 +The option with identifier {{code language="none"}}de.cau.cs.kieler.algorithm{{/code}} specifies which layout algorithm to use for the content of a composite node. 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.
536 +
537 +The following layout types are predefined:
538 +
539 +* **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.
540 +* **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.
541 +* **Force** - Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces.
542 +* **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.
543 +* **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.
544 +
545 +=== Available Algorithms and Libraries ===
546 +
547 +* **The [[KLay Project>>doc:Layout Algorithms (KLay)]]** - Java implementations of standard layout approaches, augmented with special processing of graph features such as ports and edge labels.
548 +* **Randomizer** - Distributes the nodes randomly; not very useful, but it can show how important a good layout is for understanding a graph.
549 +* (((
550 +**Box Layout** - Ignores edges, places all nodes in rows. Can be used to layout collections of unconnected boxes, such as Statechart regions.
551 +)))
552 +* **Fixed Layout** - Does not compute a new layout, but leaves all nodes and edges where they are. If the Position and Bend Points options are set for the elements of the graph, the pre-defined layout is applied.
553 +* **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.
554 +* **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.
555 +
556 +== Diagram Type ==
557 +
558 +{{id name="diagramType"/}}
559 +
560 +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.
561 +
562 +The following diagram types are predefined:
563 +
564 +* **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.
565 +* **State Machine** - All kinds of state machines, automata, and activity diagrams. Examples: [[doc:SCCharts SyncCharts]], UML Activity diagrams.
566 +* **Data Flow Diagram** - Actor-oriented diagrams, where connections are mostly done between //ports// of nodes. These diagrams can only be handled properly by very special layout algorithms, such as those developed in the [[KLay project>>doc:Layout Algorithms (KLay)]].
567 +* **Class Diagram** - Class diagrams such as Ecore diagrams for the [[EMF>>url:http://www.eclipse.org/modeling/emf/||shape="rect"]] or UML Class diagrams.
568 +* **Use Case Diagram** - Use case diagrams as defined by the UML.
569 +* **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]].
570 +
571 +== Other Options ==
572 +
573 +* **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.
574 +* **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.
575 +* **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.
576 +* **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.
577 +
513 513  = Detailed Documentation =
514 514  
515 515  This section explains every layout option in more detail.
516 516  
582 +== Edge Routing ==
583 +
584 +{{id name="edgeRouting"/}}
585 +
586 +This option influences the way in which edges are routed between the nodes they connect. The following settings are available:
587 +
588 +* POLYLINE
589 +Edges consist of one or more segments defined by a list of bend points.
590 +* ORTHOGONAL
591 +Edges are routed orthogonally, meaning that each segment of an edge runs either horizontally or vertically, but never at an angle.
592 +* SPLINE
593 +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.
594 +* UNDEFINED
595 +No particular edge routing style is selected. The result produced by the layout algorithm may be undefined.
596 +
597 +(% style="color: rgb(153,51,0);" %)**TODO:** Add an image illustrating the different routing styles.
598 +
517 517  == Port Offset ==
518 518  
601 +{{id name="portOffset"/}}
602 +
519 519  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.
604 +
605 +Set this property if one of the following cases applies:
606 +
607 +* The port constraints on a node are set to FREE, FIXED_SIDES or FIXED_ORDER.
608 +* 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.)
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -7111096
1 +9470006
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/7111096/Layout Options
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/9470006/KIML Layout Options