Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Matters get more complicated if we allow port positions to be changed. If the western port is moved upwards and the eastern port downwards, the labels don't overlap anymoreany more. Thus, label placement also influences port placement.

...

The insets area is the part of the node where port and node labels are placed (if they are placed inside the node as opposed to outside the node). The child area is what is left of the node with the insets subtracted. With the SizeOptions.COMPUTE_INSETS, KLay Layered can compute the child area and return it. This makes it easy to use in cases where the child area of the node is going to be used for displaying graphics or further text. If a minimum size is set on the node and the options SizeConstraint.MINIMUM_SIZE and SizeOPTIONSSizeOptions.MINIMUM_SIZE_ACCOUNTS_FOR_INSETS are set, the minimum size will effectively only apply to the child area. Thus, KLay Layered can be told to ensure that the child area of a node has at least a given size, whatever space the port labels and node labels require.

...

  • More than one port label.More than one
  • Different placements for each node label. More than one label can usually be combined into a single KLabel object if the labels are to be placed next to each other anywayAs of now, node labels are placed by arranging them in a vertical stack at the desired node label position.

General Approach

The general approach to solving label placement, port placement, and node sizing follows the following general pattern:

...