reaflow icon indicating copy to clipboard operation
reaflow copied to clipboard

Edges into nested nodes are taking unnecessary turns

Open ASchwad opened this issue 5 years ago • 2 comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

Edges into a nested node are taking an unnecessary bezier turn. This only occurs if the Canvas has the property direction='UP' or direction='DOWN'.

Expected behavior

The edge should head straight towards the node.

Minimal reproduction of the problem with instructions

Example (note that the Canvas prop direction='DOWN' is the default direction): <Canvas layoutOptions={ { 'elk.hierarchyHandling': 'INCLUDE_CHILDREN' } } nodes={[ { id: '1', text: '1' }, { id: '2', }, { id: '2.1', parent: '2', text: '2.1' }, { id: '3', text: '3' } ]} edges={[ { id: '1-2.1', from: '1', to: '2.1' }, { id: '1-3', from: '1', to: '3', } ]} />

grafik

ASchwad avatar Dec 13 '20 11:12 ASchwad

Ya .... This is a config option in ELKJS and that API is so difficult to understand its tough to figure these out but ELK is by far the best graph engine. I would recommend playing w/ the options until you get something like you expect.

amcdnl avatar Dec 29 '20 15:12 amcdnl

@amcdnl, are there any workarounds for this yet? @ASchwad, was there any set of options that worked for you?

The problem seems to be most pronounced with edges between child nodes; bendpoints seem to be added based on relative parent position and text size, which should perhaps not be the default behavior.

With "org.eclipse.elk.layered.wrapping.strategy": "OFF": Screen Shot 2023-03-30 at 11 43 24 AM with "org.eclipse.elk.layered.wrapping.strategy": "SINGLE_EDGE" or "MULTI_EDGE", with direction="DOWN": Screen Shot 2023-03-30 at 11 38 45 AM with direction="RIGHT": Screen Shot 2023-03-30 at 11 37 53 AM

Codesandbox: https://codesandbox.io/s/reaflow-nested-uvixbh

There is no issue about this on elkjs. Are there different default options in Reaflow that would cause this behavior?

larissa-n avatar Mar 30 '23 16:03 larissa-n