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

Error: size of dag to decrossOpt is too large and will likely crash instead of complete, enable "large" grahps to run anyway

Open Mandark-droid opened this issue 2 years ago • 5 comments

Please provide solution for above issue when using the CodePen example provided by the developer https://codepen.io/brinkbot/pen/oNZJXqK here with a large data set of 1000 plus nodes.

PS Note: We have multiple such data sets and some of them have 10K+ nodes.

Mandark-droid avatar Oct 03 '22 06:10 Mandark-droid

Thanks for submitting this, I should fix that external error string. The problem is that decrossOpt, used in the example as .decross(d3.decrossOpt()) doesn't work for large graphs. If you remove that line and go to the default, it should work for large graphs.

I'll keep this open to adjust the error text

erikbrinkman avatar Oct 03 '22 14:10 erikbrinkman

HI @erikbrinkman , As suggested if I comment out the line. .decross(d3.decrossOpt()) The error goes away but the Graph is still not getting rendered. And only one single data point is rendered and Another Observation is that If the NodeId in my Case is a String and if the String Length is long then it doesnt render the graph and if I reduce the NodeId length its rendering. Any suggestions on this issue will also be helpful.

Mandark-droid avatar Oct 07 '22 04:10 Mandark-droid

Can you give me more information? "the graph doesn't render" isn't really enough for me to figure out what's going wrong. My guess is that it is rendering, and other aspects are making it hard to view. Please check the DOM to see if the elements are there, what their size is, if they're in the svg viewport, etc.

As for the node ids, the example is set up so that the node ids become the label. If the label is really long then it will naturally result in a strange layout, so I would decide what it is you want it to render as and then fix it. Also note, that this renders nodes with a fixed size. If you want long labels to fit in the nodes, you'll want to dynamically adjust the node size.

One final thing I'll mention is that this library is not intended to be a drop in replacement for dot. I intend there to be some manual effort to actually define the layout, in the same way that d3 is not an off the shelf plotting library.

erikbrinkman avatar Oct 07 '22 15:10 erikbrinkman

Browser is running out of memory for even 50 nodes. Graph rendering takes time for 30 nodes. Data used for graph plotting: https://codepen.io/ihsahs/pen/xxjmKmE?editors=1010 Please check.

Shashirokz avatar Oct 11 '22 12:10 Shashirokz

The problem here isn't so much with the number of nodes as it is the number of edges. The places where this was dying was in trying to pick points for the edges. Changing coord to coordGreedy as in here (and updating library to 11.5) allowed the example data to render as:

cropped

It seems like this would look better if greedy did a pass up and down to make it create layouts closer to what coordSimplex creates. Howevere, I would generally say dags this large (and dense) are difficult to render in an intuitive way, and even less likely as you get into thousands of nodes. I imagine graph viz produces a slightly better layout as they tend to space nodes father away. However, if this is what you want to layout, and the graph is this dense, I'd ask what you hope to gain from the visualization. Potentially layouts like (d3-chord)[https://github.com/d3/d3-chord] might be better. Alternatively maybe you want some clustering approach to extract higher level structures, or potentially you want look at some of the discussion around dynamic layouts that allow exploration without trying to render the entire dag.

Notes to self

  • [ ] Adjust error text on decrossOpt to be more clear how to remedy (e.g. don't ignore but switch to a different decross rendering)
  • [ ] Modify coordGreedy to go both directions / and potentially other constraints that will make result closer to coordSimplex
  • [ ] Add density warning by default for sugiyama (and other layouts) explaining that dense graphs don't render well with this technique
  • [ ] Add warnings checks to other expensive operations (like coordSimplex)

erikbrinkman avatar Oct 11 '22 15:10 erikbrinkman

Hi @erikbrinkman. Sorry, if I'm just being dumb, but I can't figure out how to enable 'medium' graphs with decrossOpt. I've been doing some testing with a graphs that has 44 nodes. It really needs decrossOpt and I beleive it would render quickly, but bombs out with the 'size of dag to decrossOpt is too large...' error.

troyinsight avatar Mar 18 '23 23:03 troyinsight

@troyinsight Yeah, I know the api is sometimes not obvious. I'm working on an update. Have you tried:

sugiyama().decross(decrossOpt().large("medium"))

erikbrinkman avatar Mar 18 '23 23:03 erikbrinkman

Perfect, thank you Erik!

troyinsight avatar Mar 19 '23 00:03 troyinsight

Documentation on this should be more up to date and easier to understand.

Feel free to reopen if you don't think this has been addressed.

erikbrinkman avatar Jul 02 '23 17:07 erikbrinkman