Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# News

## metacoder 0.3.9.9000 (development version)

* Fixed `heat_tree()` erroring with `The value <x> is not representable as an integer. Invalid value` when using `layout = "davidson-harel"` on a graph with a connected component larger than 1024 nodes. The `fineiter` argument passed to `igraph::layout_with_dh()` must be an integer, but was computed as `max(10, log2(vcount(graph)))`, which is non-integer once `vcount > 1024`. It is now rounded (issue [#362](https://github.com/grunwaldlab/metacoder/issues/362)).

## metacoder 0.3.9

* Maintenance release to fix CRAN check issues.
Expand Down
9 changes: 7 additions & 2 deletions R/heat_tree--layouts.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ layout_functions <- function(name = NULL, graph = NULL, intitial_coords = NULL,
"reingold-tilford" = list(circular = TRUE,
mode = "out"),
"davidson-harel" = list(coords = intitial_coords,
maxiter = 10 * effort,
fineiter = max(10, log2(igraph::vcount(graph))) * effort,
maxiter = round(10 * effort),
# `fineiter` is passed to igraph::layout_with_dh(), which
# requires an integer. `log2(vcount)` is non-integer once a
# (connected component of the) graph exceeds 1024 nodes, so
# round to avoid igraph's "not representable as an integer"
# error (grunwaldlab/metacoder#362).
fineiter = round(max(10, log2(igraph::vcount(graph))) * effort),
cool.fact = 0.75 - effort * 0.1,
weight.node.dist = 13, #* ifelse(is.null(v_weight), 1, list(rescale(v_weight, c(.1, 10))))[[1]], #higher values spread out nodes
weight.border = 0,
Expand Down