dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.85k stars 587 forks source link

Rendering large graph using phantom.js #85

Open ghost opened 10 years ago

ghost commented 10 years ago

I tried to generate the static picture of the rendered graph with phantom.js, but when node number is huge, it will exceed browser stack limit. I think the the stack size for webkit render engine is 500. So I changed the DFS function inside dagre to itterative instead of recursion. Does that affect any performance?

cpettitt commented 10 years ago

Which DFS function? You should be able to safely switch to using a stack anywhere we're doing DFS. If anything, it might perform slightly better depending on how well the optimizer handles that part of the code.

ghost commented 10 years ago

Thanks a lot! Only stack exceed limit error occur for this function dfs(v, component), so I changed it to iterative.