recurse_layout fails for very deep trees
teng-gao opened this issue · comments
Teng Gao commented
Hi @thomasp85,
When plotting a deep tree (height > 4000), we run into the issue of C stack overflow, triggered by the recursions in recurse_layout
.
Reproducible example: tree_final_1.rds.zip
gtree = readRDS('tree_final_1.rds')
gtree %>% ggraph(layout = 'dendrogram')
output:
Error: C stack usage 7969588 is too close to the limit
traceback:
....
14: recurse_layout(gr, i, layout, direction, offset)
13: recurse_layout(gr, i, layout, direction, offset)
12: recurse_layout(gr, i, layout, direction, offset)
11: recurse_layout(gr, i, layout, direction, offset)
10: recurse_layout(gr, i, layout, direction, offset)
9: recurse_layout(graph, i, nodes, direction = direction, offset)
8: layout_fun(graph, circular = circular, ...)
7: layout_to_table.character(layout, graph, circular = circular,
...)
6: layout_to_table(layout, graph, circular = circular, ...)
5: create_layout.tbl_graph(graph, layout, ...)
4: create_layout(graph, layout, ...)
3: ggplot(data = create_layout(graph, layout, ...), environment = envir)
2: ggraph(., layout = "dendrogram")
1: gtree %>% ggraph(layout = "dendrogram")
Would really appreciate your help on this!
Thanks,
Teng
Thomas Lin Pedersen commented
Fixed in dev