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

Why do these edges cause errors? #358

Open
randolchance opened this issue Aug 28, 2023 · 0 comments
Open

Why do these edges cause errors? #358

randolchance opened this issue Aug 28, 2023 · 0 comments

Comments

@randolchance
Copy link

Very apologies if this has been asked before somewhere. I did look for a similar issue.

I'm trying to understand how dagre works behind the scenes, the math and formulation and that, in the hopes that I might understand why the following graph(s) fail:

// Set the nodes
g.setNode('a', {
  label: 'A'
});
g.setNode('b', {
  label: 'B'
});
g.setNode('c', {
  label: 'C'
});
g.setNode('d', {
  label: 'D'
});
// Set the parents
g.setParent('b', 'a');
g.setParent('c', 'b');

// These edges cause errors:
//g.setEdge('a', 'b');
//g.setEdge('a', 'c');
//g.setEdge('a', 'd');
//g.setEdge('b', 'c');
//g.setEdge('a', 'a');
//g.setEdge('b', 'b');

// These edges don't cause errors
//g.setEdge('c', 'd');
//g.setEdge('d', 'c');
//g.setEdge('c', 'c');
//g.setEdge('d', 'd');

Here is a jsfiddle to demonstrate, just uncomment an edge that causes an error.

Any insights anyone has to offer would be appreciated. I'm interested in learning how dagre works from theory up if I have to to solve this. And if I do solve it I would happily contribute the fix.

Thanks!

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

No branches or pull requests

1 participant