elk icon indicating copy to clipboard operation
elk copied to clipboard

LabelDummyInserter should preserve position for interactive layout

Open protogenes opened this issue 2 years ago • 0 comments

LabelDummyInserter should provide a position for the dummy node, so that interactive layout can produce usable results, otherwise the labels will be placed on the upper end of the graph (at 0).

This is trivial for a single label on the edge. When stacking multiple labels any of their position could probably be choosen freely.

InteractiveNodePlacer could benefit from setting ORIGINAL_DUMMY_NODE_POSITION as well.

Might relate to #838.

//algorithm: fixed
algorithm: layered
cycleBreaking.strategy: INTERACTIVE
layering.strategy: INTERACTIVE
crossingMinimization.strategy: INTERACTIVE
nodePlacement.strategy: INTERACTIVE

node n1 {layout [position: 0,100]}
node n2 {layout [position: 200,0]}
node n3 {layout [position: 400,0]}
node n4 {layout [position: 400,200]}
node n5 {layout [position: 600,100]}
edge n1 -> n2
edge n2 -> n3
edge n3 -> n5
edge n4 -> n5
edge n1 -> n4 {
    layout [start: 30,120 end: 400,215 bends: 200,200]
     label "foo" {
        layout [ position: 200,200 ]
        org.eclipse.elk.edgeLabels.placement: CENTER
    }
}

protogenes avatar Nov 29 '22 09:11 protogenes