Open JHERR1112 opened 2 years ago
You would have to use separate ports, or do not use ports at all.
Hi, I have a question related to this one. For orthogonal edges, is it possible to let the edges only merge on the very last junction reaching the port, and not along most of the path?
In the example, I use a single port for all incoming edges on node n4. There are edges coming in from different layers, and they are heavily merged. I'm looking for a way to draw all these edges as separate lines, merging only the very last part they are approaching the target port.
I cannot think of any option that does this. The only solution is to add separate ports. Have you tried to add multiple ports with the exact same fixed port position? For example like this.
@soerendomroes, that's an interesting idea. I'll try that, thanks!
Hmm, for some reason it's not working with v0.7.1 for me.
Tried converting all edges to use only ports. All ports are defined and have width=1 and x=1 (using JSON format). Tried 'FIXED_POS' and 'FIXED_ORDER' with index + portSide.
Keep getting this exception:
TypeError: Cannot read properties of null (reading 'x_0')
at createExternalPortDummy (elkjs-rebundle.js:31846:45)
at $transformHierarchyEdges (elkjs-rebundle.js:31075:25)
at $transformHierarchyEdges (elkjs-rebundle.js:31065:20)
at $process_1 (elkjs-rebundle.js:30912:3)
at $doCompoundLayout (elkjs-rebundle.js:27852:3)
at LayeredLayoutProvider.layout_2 [as layout] (elkjs-rebundle.js:28169:160)
at $executeAlgorithm (elkjs-rebundle.js:61787:20)
at $layoutRecursively (elkjs-rebundle.js:61877:5)
at $layout_3 (elkjs-rebundle.js:61822:3)
at layout_11 (elkjs-rebundle.js:73955:3)
at Dispatcher.dispatch (elkjs-rebundle.js:73884:11)
at Dispatcher.saveDispatch (elkjs-rebundle.js:73892:15)
at elkjs-rebundle.js:73909:26
Any clue? I couldn't get any useful info about the port (which edge/node) during debugging.
The line it fails on:
informationAboutIt = portPosition.x_0;
portPosition
is null.
How can I define portPosition?
I have a hierarchical graph with hierarchyHandling='INCLUDE_CHILDREN' and the problem seems to happen only when there are nested nodes.
Can you provide me with a minimal example via the ELK Demonstrator (Json)?
I'll try preparing something later on. Thank you for the help.
@soerendomroes here it is:
It actually works with the demonstrator, but when I use elkjs@0.7.1 from npm it fails wit hnow different exception:
Error: java.lang.IllegalStateException: NEdge must have a source and target NNode specified.
at IllegalStateException_0.createError (elkjs-rebundle.js:7957:10)
at IllegalStateException_0.initializeBackingError (elkjs-rebundle.js:7977:40)
at IllegalStateException_0.Throwable_0 (elkjs-rebundle.js:7933:8)
at IllegalStateException_0.RuntimeException_0 (elkjs-rebundle.js:7996:15)
at new IllegalStateException_0 (elkjs-rebundle.js:11084:22)
at $create_1 (elkjs-rebundle.js:20789:16)
at $transformEdge_0 (elkjs-rebundle.js:52518:11)
at NetworkSimplexPlacer$lambda$5$Type.accept_125 [as accept] (elkjs-rebundle.js:53029:3)
at $lambda$0_1 (elkjs-rebundle.js:19175:14)
at StreamImpl$FilterSpliterator$lambda$0$Type.accept_29 [as accept] (elkjs-rebundle.js:19203:3)
at $tryAdvance (elkjs-rebundle.js:17082:14)
at Spliterators$IteratorSpliterator_0.tryAdvance_2 [as tryAdvance] (elkjs-rebundle.js:17121:10)
at StreamImpl$1.tryAdvance_12 [as tryAdvance] (elkjs-rebundle.js:19108:21)
at StreamImpl$FilterSpliterator.tryAdvance_14 [as tryAdvance] (elkjs-rebundle.js:19189:39)
at $forEachRemaining_0 (elkjs-rebundle.js:3237:22)
at StreamImpl$FilterSpliterator.forEachRemaining_34 [as forEachRemaining] (elkjs-rebundle.js:17191:3)
at $forEach_3 (elkjs-rebundle.js:18977:27)
at $buildInitialAuxiliaryGraph (elkjs-rebundle.js:52187:3)
at $process_70 (elkjs-rebundle.js:52455:3)
at NetworkSimplexPlacer.process_67 [as process] (elkjs-rebundle.js:52657:3)
at $hierarchicalLayout (elkjs-rebundle.js:27916:21)
at $doCompoundLayout (elkjs-rebundle.js:27853:3)
at LayeredLayoutProvider.layout_2 [as layout] (elkjs-rebundle.js:28169:160)
at $executeAlgorithm (elkjs-rebundle.js:61787:20)
at $layoutRecursively (elkjs-rebundle.js:61877:5)
at $layout_3 (elkjs-rebundle.js:61822:3)
at layout_11 (elkjs-rebundle.js:73955:3)
at Dispatcher.dispatch (elkjs-rebundle.js:73884:11)
at Dispatcher.saveDispatch (elkjs-rebundle.js:73892:15)
If you set your nodePlacement.strategy
to something else than NETWORK_SIMPLEX
it works and
creates this drawing:
I guess the algorithm fails to put the port, which is created since the edge crosses a hierarchy boundary, on grp1 on the north side of the node and the network simplex algorithm cannot deal with that.
PS: You can embed links with [name](url)
For your other problem, I suggest creating a ticket in ELK.
OK, thank you. I was jumping between NETWORK_SIMPLEX and BRANDES_KOEPF for 'nodePlacement.strategy'. That might explain why I was getting two different exceptions. I'll file an issue for the second one.
I found this ticket and it quite describes the problem I'm having: https://github.com/eclipse/elk/issues/754
Looks like it's going to be fixed in 0.8.0, right?
I also managed to reproduce the exception directly in the demonstrator.
In my original code I'm using a lot of default layoutOptions, and one of them is
'elk.portConstraints': 'FIXED_POS'
.
When this option is added to a nested group inside a group (group_1 in my example), the exception reproduces.
Same for 'elk.portConstraints': 'FIXED_ORDER'
.
No that is a different issue and seems to relate to cross hierarchy edges.
I just the problem I'm facing with elkjs@next which points to 0.7.3-dev
.
The problem is still reproducing.
Going to file a different ticket then.
I have created a simple graph in the ELK Demonstrators site as follows:
As you can see, I am creating 2 edges from
n1.p1
ton2.p1
. I expected there to be space between the edges, but they seem to overlap. Is there anyway we can apply space between the edges?