Changes for page KIML Layout Options

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

From version 18.1
edited by msp
on 2014/03/07 17:04
Change comment: There is no comment for this version
To version 23.1
edited by msp
on 2014/03/13 10:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,8 +1,6 @@
1 -{{warning}}
2 -This is preliminary and incomplete documentation. You've been warned.
3 -{{/warning}}
1 +
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. When an option is supported by an algorithm, that algorithm may override the option's default value. Algorithms may also provide more specialized documentation for layout options.
3 +KIML defines a whole set of standard layout options that many layout algorithms support. When an option is supported by an algorithm, that algorithm may override the option's default value. Algorithms may also provide more specialized documentation for layout options.
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 s{{code language="none"}}et{{/code}} over a given enumeration), or Object (a non-primitive Java object). The types Enum and EnumSet have to be further defined by an enumeration class. The Object type can be constricted to a certain Java class.
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, or Labels.
17 +* The kinds of graph objects the option applies to. At least one of Nodes, Edges, Ports, Labels, or Parents (nodes that have children, including the diagram root node). Parents-applicable options affect whole graphs or subgraphs, while options with other application targets affect only single graph elements.
20 20  * An optional default value. A default value may also be provided by the layout algorithm using the option, or by the modeling application you are using. In these cases the value given here is overridden.
21 21  
22 22  Layout options can be assigned to two main categories: user options and programmatic options.
... ... @@ -37,7 +37,7 @@
37 37  Default
38 38  )))
39 39  |(((
40 -Alignment
38 +[[Alignment>>doc:||anchor="alignment"]]
41 41  )))|(((
42 42  de.cau.cs.kieler.alignment
43 43  )))|(((
... ... @@ -48,7 +48,7 @@
48 48  AUTOMATIC
49 49  )))
50 50  |(((
51 -Aspect Ratio
49 +[[Aspect Ratio>>doc:||anchor="aspectRatio"]]
52 52  )))|(((
53 53  de.cau.cs.kieler.aspectRatio
54 54  )))|(((
... ... @@ -148,7 +148,7 @@
148 148  
149 149  )))
150 150  |(((
151 -Layout Hierarchy
149 +[[Layout Hierarchy>>doc:||anchor="layoutHierarchy"]]
152 152  )))|(((
153 153  de.cau.cs.kieler.layoutHierarchy
154 154  )))|(((
... ... @@ -349,6 +349,54 @@
349 349  )))|=(((
350 350  Default
351 351  )))
350 +|(% colspan="1" %)(% colspan="1" %)
351 +(((
352 +Animate
353 +)))|(% colspan="1" %)(% colspan="1" %)
354 +(((
355 +de.cau.cs.kieler.animate
356 +)))|(% colspan="1" %)(% colspan="1" %)
357 +(((
358 +Boolean
359 +)))|(% colspan="1" %)(% colspan="1" %)
360 +(((
361 +Parents
362 +)))|(% colspan="1" %)(% colspan="1" %)
363 +(((
364 +true
365 +)))
366 +|(% colspan="1" %)(% colspan="1" %)
367 +(((
368 +Animation Time Factor
369 +)))|(% colspan="1" %)(% colspan="1" %)
370 +(((
371 +de.cau.cs.kieler.animTimeFactor
372 +)))|(% colspan="1" %)(% colspan="1" %)
373 +(((
374 +Int
375 +)))|(% colspan="1" %)(% colspan="1" %)
376 +(((
377 +Parents
378 +)))|(% colspan="1" %)(% colspan="1" %)
379 +(((
380 +100
381 +)))
382 +|(% colspan="1" %)(% colspan="1" %)
383 +(((
384 +[[Comment Box>>doc:||anchor="commentBox"]]
385 +)))|(% colspan="1" %)(% colspan="1" %)
386 +(((
387 +de.cau.cs.kieler.commentBox
388 +)))|(% colspan="1" %)(% colspan="1" %)
389 +(((
390 +Boolean
391 +)))|(% colspan="1" %)(% colspan="1" %)
392 +(((
393 +Nodes
394 +)))|(% colspan="1" %)(% colspan="1" %)
395 +(((
396 +false
397 +)))
352 352  |(((
353 353  [[Diagram Type>>doc:||anchor="diagramType"]]
354 354  )))|(((
... ... @@ -421,7 +421,7 @@
421 421  )))
422 422  |(% colspan="1" %)(% colspan="1" %)
423 423  (((
424 -Hypernode
470 +[[Hypernode>>doc:||anchor="hypernode"]]
425 425  )))|(% colspan="1" %)(% colspan="1" %)
426 426  (((
427 427  de.cau.cs.kieler.hypernode
... ... @@ -437,6 +437,54 @@
437 437  )))
438 438  |(% colspan="1" %)(% colspan="1" %)
439 439  (((
486 +Layout Ancestors
487 +)))|(% colspan="1" %)(% colspan="1" %)
488 +(((
489 +de.cau.cs.kieler.layoutAncestors
490 +)))|(% colspan="1" %)(% colspan="1" %)
491 +(((
492 +Boolean
493 +)))|(% colspan="1" %)(% colspan="1" %)
494 +(((
495 +Parents
496 +)))|(% colspan="1" %)(% colspan="1" %)
497 +(((
498 +false
499 +)))
500 +|(% colspan="1" %)(% colspan="1" %)
501 +(((
502 +Maximal Animation Time
503 +)))|(% colspan="1" %)(% colspan="1" %)
504 +(((
505 +de.cau.cs.kieler.maxAnimTim
506 +)))|(% colspan="1" %)(% colspan="1" %)
507 +(((
508 +Int
509 +)))|(% colspan="1" %)(% colspan="1" %)
510 +(((
511 +Parents
512 +)))|(% colspan="1" %)(% colspan="1" %)
513 +(((
514 +4000
515 +)))
516 +|(% colspan="1" %)(% colspan="1" %)
517 +(((
518 +Minimal Animation Time
519 +)))|(% colspan="1" %)(% colspan="1" %)
520 +(((
521 +de.cau.cs.kieler.minAnimTim
522 +)))|(% colspan="1" %)(% colspan="1" %)
523 +(((
524 +Int
525 +)))|(% colspan="1" %)(% colspan="1" %)
526 +(((
527 +Parents
528 +)))|(% colspan="1" %)(% colspan="1" %)
529 +(((
530 +400
531 +)))
532 +|(% colspan="1" %)(% colspan="1" %)
533 +(((
440 440  Minimal Height
441 441  )))|(% colspan="1" %)(% colspan="1" %)
442 442  (((
... ... @@ -471,7 +471,7 @@
471 471  )))
472 472  |(% colspan="1" %)(% colspan="1" %)
473 473  (((
474 -No Layout
568 +[[No Layout>>doc:||anchor="noLayout"]]
475 475  )))|(% colspan="1" %)(% colspan="1" %)
476 476  (((
477 477  de.cau.cs.kieler.noLayout
... ... @@ -487,6 +487,22 @@
487 487  )))
488 488  |(% colspan="1" %)(% colspan="1" %)
489 489  (((
584 +Port Index
585 +)))|(% colspan="1" %)(% colspan="1" %)
586 +(((
587 +de.cau.cs.kieler.portIndex
588 +)))|(% colspan="1" %)(% colspan="1" %)
589 +(((
590 +Int
591 +)))|(% colspan="1" %)(% colspan="1" %)
592 +(((
593 +Ports
594 +)))|(% colspan="1" %)(% colspan="1" %)
595 +(((
596 +
597 +)))
598 +|(% colspan="1" %)(% colspan="1" %)
599 +(((
490 490  [[Port Offset>>doc:||anchor="portOffset"]]
491 491  )))|(% colspan="1" %)(% colspan="1" %)
492 492  (((
... ... @@ -517,9 +517,109 @@
517 517  (((
518 518  
519 519  )))
630 +|(% colspan="1" %)(% colspan="1" %)
631 +(((
632 +Progress Bar
633 +)))|(% colspan="1" %)(% colspan="1" %)
634 +(((
635 +de.cau.cs.kieler.progressBar
636 +)))|(% colspan="1" %)(% colspan="1" %)
637 +(((
638 +Boolean
639 +)))|(% colspan="1" %)(% colspan="1" %)
640 +(((
641 +Parents
642 +)))|(% colspan="1" %)(% colspan="1" %)
643 +(((
644 +false
645 +)))
646 +|(% colspan="1" %)(% colspan="1" %)
647 +(((
648 +Scale Factor
649 +)))|(% colspan="1" %)(% colspan="1" %)
650 +(((
651 +de.cau.cs.kieler.scaleFactor
652 +)))|(% colspan="1" %)(% colspan="1" %)
653 +(((
654 +Float
655 +)))|(% colspan="1" %)(% colspan="1" %)
656 +(((
657 +Nodes
658 +)))|(% colspan="1" %)(% colspan="1" %)
659 +(((
660 +1.0
661 +)))
662 +|(% colspan="1" %)(% colspan="1" %)
663 +(((
664 +Thickness
665 +)))|(% colspan="1" %)(% colspan="1" %)
666 +(((
667 +de.cau.cs.kieler.thickness
668 +)))|(% colspan="1" %)(% colspan="1" %)
669 +(((
670 +Float
671 +)))|(% colspan="1" %)(% colspan="1" %)
672 +(((
673 +Edges
674 +)))|(% colspan="1" %)(% colspan="1" %)
675 +(((
676 +1.0
677 +)))
678 +|(% colspan="1" %)(% colspan="1" %)
679 +(((
680 +Zoom to Fit
681 +)))|(% colspan="1" %)(% colspan="1" %)
682 +(((
683 +de.cau.cs.kieler.zoomToFit
684 +)))|(% colspan="1" %)(% colspan="1" %)
685 +(((
686 +Boolean
687 +)))|(% colspan="1" %)(% colspan="1" %)
688 +(((
689 +Parents
690 +)))|(% colspan="1" %)(% colspan="1" %)
691 +(((
692 +false
693 +)))
520 520  
695 +=== Layout Output Properties ===
696 +
697 +A few properties are used as additional information in the output of a layout algorithm. This information should be considered when the layout is applied to the original diagram
698 +
699 +|=(((
700 +Property
701 +)))|=(((
702 +ID
703 +)))|=(((
704 +Type
705 +)))|=(((
706 +Applies to
707 +)))
708 +|(((
709 +[[Edge Routing>>doc:||anchor="edgeRouting"]]
710 +)))|(((
711 +de.cau.cs.kieler.edgeRouting
712 +)))|(((
713 +Enum
714 +)))|(((
715 +Edges
716 +)))
717 +|(((
718 +Junction Points
719 +)))|(((
720 +de.cau.cs.kieler.junctionPoints
721 +)))|(((
722 +Object
723 +)))|(((
724 +Edges
725 +)))
726 +
727 +
728 +
521 521  = Detailed Documentation =
522 522  
731 +This section explains every layout option in more detail.
732 +
523 523  == The Most Important Options ==
524 524  
525 525  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.
... ... @@ -528,19 +528,15 @@
528 528  
529 529  {{id name="layoutAlgorithm"/}}
530 530  
531 -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.
741 +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>>doc:||anchor="layoutHierarchy"]] option is active.
532 532  
533 -The following layout types are predefined:
743 +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.
534 534  
535 -* **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.
536 -* **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.
537 -* **Force** - Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces.
538 -* **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.
539 -* **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.
745 +[[image:attach:layout_algorithm.png]]
540 540  
541 -=== Available Algorithms and Libraries ===
747 +==== Available Algorithms and Libraries ====
542 542  
543 -* **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.
749 +* **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.
544 544  * **Randomizer** - Distributes the nodes randomly; not very useful, but it can show how important a good layout is for understanding a graph.
545 545  * (((
546 546  **Box Layout** - Ignores edges, places all nodes in rows. Can be used to layout collections of unconnected boxes, such as Statechart regions.
... ... @@ -549,6 +549,14 @@
549 549  * **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.
550 550  * **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.
551 551  
758 +==== Predefined Layout Types ====
759 +
760 +* **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.
761 +* **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.
762 +* **Force** - Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces.
763 +* **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.
764 +* **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.
765 +
552 552  === Diagram Type ===
553 553  
554 554  {{id name="diagramType"/}}
... ... @@ -564,15 +564,6 @@
564 564  * **Use Case Diagram** - Use case diagrams as defined by the UML.
565 565  * **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]].
566 566  
567 -== Other Options ==
568 -
569 -* **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.
570 -* **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.
571 -* **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.
572 -* **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.
573 -
574 -This section explains every layout option in more detail.
575 -
576 576  === Edge Routing ===
577 577  
578 578  {{id name="edgeRouting"/}}
... ... @@ -582,14 +582,66 @@
582 582  * POLYLINE
583 583  Edges consist of one or more segments defined by a list of bend points.
584 584  * ORTHOGONAL
585 -Edges are routed orthogonally, meaning that each segment of an edge runs either horizontally or vertically, but never at an angle.
586 -* SPLINE
587 -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.
790 +Edges are routed orthogonally, meaning that each segment of an edge runs either horizontally or vertically.
791 +* SPLINES
792 +Edges are routed as splines (smooth curves).
588 588  * UNDEFINED
589 -No particular edge routing style is selected. The result produced by the layout algorithm may be undefined.
794 +No particular edge routing style is selected. Usually this value points to the default setting of the selected layout algorithm.
590 590  
591 -(% style="color: rgb(153,51,0);" %)**TODO:** Add an image illustrating the different routing styles.
796 +[[image:attach:edge_routing.png]]
592 592  
798 +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:
799 +
800 +1. Start at the source point of the edge.
801 +1. As long as there are at least three bend points left:
802 +11. Draw a cubic spline segment to the third bend point with the other two bend points as control points.
803 +11. Use the third bend point as start point for the next segment.
804 +11. Consume the three bend points and proceed to the next segment.
805 +1. Check the number of remaining bend points:
806 +11. Two bend points – draw a cubic spline segment to the target point of the edge.
807 +11. One bend point – draw a quadratic spline segment to the target point of the edge.
808 +11. No bend point – draw a straight line to the target point of the edge.
809 +
810 +== Other Options ==
811 +
812 +=== Alignment ===
813 +
814 +{{id name="alignment"/}}
815 +
816 +Determines 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.
817 +
818 +=== Aspect Ratio ===
819 +
820 +{{id name="aspectRatio"/}}
821 +
822 +The 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.
823 +
824 +=== Comment Box ===
825 +
826 +{{id name="commentBox"/}}
827 +
828 +A 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.
829 +
830 +[[image:attach:comment_box.png]]
831 +
832 +=== (% style="line-height: 1.5625;" %)Hypernode(%%) ===
833 +
834 +{{id name="hypernode"/}}
835 +
836 +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.
837 +
838 +=== Layout Hierarchy ===
839 +
840 +{{id name="layoutHierarchy"/}}
841 +
842 +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.
843 +
844 +=== No Layout ===
845 +
846 +{{id name="noLayout"/}}
847 +
848 +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.
849 +
593 593  === Port Offset ===
594 594  
595 595  {{id name="portOffset"/}}
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -9470010
1 +9470042
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/9470010/KIML Layout Options
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/9470042/KIML Layout Options