elk icon indicating copy to clipboard operation
elk copied to clipboard

Jep/node label adjustment

Open Drakae opened this issue 2 years ago • 1 comments

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. multipleLabelsOriginal

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

multipleLabels

Drakae avatar Dec 16 '22 12:12 Drakae

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.

sailingKieler avatar Jan 06 '23 15:01 sailingKieler