dagre-layout icon indicating copy to clipboard operation
dagre-layout copied to clipboard

TypeError: Cannot set property 'order' of undefined

Open mmacfadden opened this issue 7 years ago • 5 comments

Not sure if you have any interest in this. I am cross posting this from the main dagre repo. Basically I have a graph that when laid out throws the following error:

TypeError: Cannot set property 'order' of undefined
    at ./node_modules/dagre-layout/dist/dagre-layout.core.js:1:16798
    at arrayEach (./node_modules/dagre-layout/node_modules/lodash/lodash.js:508:11)
    at Function.forEach (./node_modules/dagre-layout/node_modules/lodash/lodash.js:9334:14)
    at./node_modules/dagre-layout/dist/dagre-layout.core.js:1:16759
    at arrayEach (./node_modules/dagre-layout/node_modules/lodash/lodash.js:508:11)
    at Function.forEach (.source/node_modules/dagre-layout/node_modules/lodash/lodash.js:9334:14)
    at v (./node_modules/dagre-layout/dist/dagre-layout.core.js:1:16727)
    at t.default (./node_modules/dagre-layout/dist/dagre-layout.core.js:1:17145)
    at ./node_modules/dagre-layout/dist/dagre-layout.core.js:1:30614
    at w (./dagre-layout/dist/dagre-layout.core.js:1:3619)

I was able to replicate this, in this fork also. Here is the relevant gist.

https://gist.github.com/mmacfadden/2c923a6c7209308745296d489289f316

Here is the Dagre issue: https://github.com/dagrejs/dagre/issues/234

mmacfadden avatar Apr 05 '18 03:04 mmacfadden

Can you reproduce the issue here: https://mermaidjs.github.io/mermaid-live-editor/ ?

If so, please post the link back and I will definitely take a look.

tylerlong avatar Apr 12 '18 02:04 tylerlong

+1 here. Would having too many nodes and edges be the reason? My data had 1k+ nodes..

frozenL avatar Apr 28 '18 23:04 frozenL

@tylerlong I will try to reproduce it there. @frozenL I was able to reproduce it in a graph with about 15 nodes.

mmacfadden avatar Apr 29 '18 00:04 mmacfadden

Can you reproduce the issue here: https://mermaidjs.github.io/mermaid-live-editor/ ?

If so, please post the link back and I will definitely take a look.

Are you using dagre for any of these diagrams? I tried copying the reproducer from @mmacfadden but no luck https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFJcbiAgIGEtLT5kXG4gICBiLS0-ZVxuICAgYy0tPmZcbiAgIGMtLT5nXG4gICAgc3ViZ3JhcGggb25lXG4gICAgICAgYVxuICAgICAgIGJcbiAgICBlbmRcbiAgICBzdWJncmFwaCB0d29cbiAgICAgICAgY1xuICAgIGVuZFxuICAgIHN1YmdyYXBoIHRocmVlXG4gICAgICAgIGRcbiAgICBlbmRcbiAgICBzdWJncmFwaCBmb3VyXG4gICAgICAgIGVcbiAgICAgICAgZlxuICAgICAgICBnXG4gICAgZW5kXG4gICAgc3ViZ3JhcGggZml2ZVxuICAgICAgICBoLS0-aVxuICAgIGVuZFxuICAgIHN1YmdyYXBoIHNpeFxuICAgICAgICBqLS0-a1xuICAgIGVuZFxuICAgIHN1YmdyYXBoIHNldmVuXG4gICAgICAgIGxcbiAgICBlbmRcbiAgICBzdWJncmFwaCBlaWdodFxuICAgICAgICBtLS0-blxuICAgICAgICBuLS0-b1xuICAgIGVuZFxuIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0

Of course, the same reproducer work (as is, it fails equally) if used with dagre-layout instead of dagre

josejulio avatar Jun 21 '18 21:06 josejulio

@josejulio I was using dagre itself and was able to reproduce directly in dagre. I cross posted the issue over here since some development was going on in this port as well.

mmacfadden avatar Jun 22 '18 15:06 mmacfadden