Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] 2 Configuration questions/problems #321

Open
nlafleur opened this issue Jan 22, 2025 · 2 comments
Open

[Question] 2 Configuration questions/problems #321

nlafleur opened this issue Jan 22, 2025 · 2 comments
Labels

Comments

@nlafleur
Copy link

Ask your questions
I have 2 questions about the elkjs configuration:

  1. 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))
  2. 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:
Image

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:
Image
Please ignore the text outside the "nodes"

Screenshots
This is the current (initial) behavior based on the config above:
Image

ELK Version
"elkjs": "0.9.3"
"reactflow": "11.11.4"

@soerendomroes
Copy link
Member

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.

@Eddykasp
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants