[Question] 2 Configuration questions/problems
Ask your questions I have 2 questions about the elkjs configuration:
- The ordering should be closer to the "expected behavior screenshot" (perferably a (top-left to bottom right) ordering by node ID (added red number in "expected behaviour screenshot" at the nodes))
- The current behavior draws the edges across the nodes, would be nice if this can be prevented. I've tried setting the "Edge routing" to SPLINES:
"elk.edgeRouting": "SPLINES",
"elk.layered.edgeRouting.splines.mode": "CONSERVATIVE",
but this doesn't give the expected result:
I am using "React-Flow" with the "Elk js" algorithm. This is my configuration:
const elkOptions = {
"elk.algorithm": "layered",
"elk.hierarchyHandling": "INCLUDE_CHILDREN",
"elk.spacing.commentComment": 0,
"elk.spacing.commentNode": 0,
"elk.spacing.componentComponent": 0,
"elk.spacing.edgeLabel": 0,
"elk.spacing.edgeNode": 0,
"elk.spacing.edgeEdge": 0,
"elk.spacing.labelPortHorizontal": 0,
"elk.spacing.labelNode": 0,
"elk.spacing.labelLabel": 0,
"elk.spacing.nodeSelfLoop": 0,
"elk.spacing.nodeNode": 50, // verticale spacing tussen node
"elk.spacing.portPort": 0,
"elk.layered.compaction.connectedComponents": false,
"elk.layered.wrapping.additionalEdgeSpacing": 0,
"elk.layered.wrapping.multiEdge.improveCuts": true,
"elk.layered.wrapping.multiEdge.improveWrappedEdges": true,
"elk.layered.spacing.edgeEdgeBetweenLayers": 0,
"elk.layered.spacing.edgeNodeBetweenLayers": 0,
"elk.layered.spacing.nodeNodeBetweenLayers": 100, // horizontale spacing tussen nodes
}
Expected behavior
This was the concept drawing of the nodes:
Please ignore the text outside the "nodes"
Screenshots
This is the current (initial) behavior based on the config above:
ELK Version "elkjs": "0.9.3" "reactflow": "11.11.4"
You might want to take a look at this blogpost if you want to constrain the ordering of nodes.
The edge node overlaps are a problem of reactflow. Typically, this happens since the rendering of the node is bigger than the layout node ELK receives.
I would also ask you to replicate your issue in elk-live (which is currently down so maybe do that later). This way you could try out different options and see how they work together using only ELK.
If elk-live is down you can also run it yourself using docker docker run ghcr.io/kieler/elk-live:master. The links to graphs it exports will work for any hosted elk-live.
https://github.com/kieler/elk-live/pkgs/container/elk-live