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

Setting parent causes rendering to fail

Open jsommr opened this issue 6 years ago • 2 comments

When assigning a parent to a node, the rendering fails with TypeError: label is undefined.

Example: http://jsbin.com/qemoqitowa/edit?html,output (look for "parent": "Flow TWO")

If I don't assign a parent, the graph is rendered correctly: http://jsbin.com/zozixipugo/edit?html,output (only difference is that "parent": "Flow TWO" is removed)

jsommr avatar Aug 11 '18 10:08 jsommr

I was getting the same error, bringing me to your post. Your example does not currently have any usage of parent. When I run the example, it doesn't render because the SVG dimensions are incorrect.

By changing the SVG line to the following, your first example works: <svg id="svg-canvas" width=500 height=500></svg>

In my case, I eventually realized my TypeError: label is undefined error came from creating an edge between a child and a parent.

I suggest closing this issue and consider filing an enhancement request to make the error message more useful, assuming that is actually the cause of the error.

joshchamberlain avatar Mar 06 '19 21:03 joshchamberlain

Possibly related: #152

joshchamberlain avatar Mar 06 '19 21:03 joshchamberlain