elk
elk copied to clipboard
Jep/node label adjustment
When using NETWORK_SIMPLEX and NODE_SIZE nodeFlexibility the node flexibility possibly increases the width of nodes. As a result multiple labels may be placed beside each other. With the new property "labelMerging" the user can define which labels should be tried to place beside each other.
Added a property and a postprocessor to merge labels when using NETWORK_SIMPLEX and NODE_SIZE nodeFlexibility. Currently only implemented for the layout directions UP and DOWN.
In the following example the second, third, and fourth label of the node n1 are merged.
org.eclipse.elk.direction: DOWN
org.eclipse.elk.algorithm: layered
org.eclipse.elk.layered.nodePlacement.strategy: NETWORK_SIMPLEX
org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default: NODE_SIZE
org.eclipse.elk.spacing.portsSurrounding: "[top=10.0,left=10.0,bottom=10.0,right=10.0]"
node n1 {
nodePlacement.networkSimplex.nodeFlexibility.labelMerging: "[start=2, end=4]"
label "naecafc1"
label "hggsdsdg"
label "hjkfh"
label "hjha"
}
node n2
node n3
node n4
edge n2 -> n1
edge n3 -> n1
edge n4 -> n1
Just a general comment from outside as I drifted over here from https://github.com/kieler/KLighD/pull/149
Does it really make sense to re-arrange and relocate labels by moving over the text and deleting them? I would expect that the layouter just re-locates the label objects and/or annotates them to be not displayed by the viewer instead of deleting structural diagram elements.