Skip to content

Commit

Permalink
fix issue where some json have empty elements for x and y.
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jan 25, 2023
1 parent d1977e0 commit fa9918f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,12 @@ read_heatmap_records <- function(records, viewport_dims) {
)

lapply(tmp_data, function(d) {
d$x <- round(d$x * viewport_dims$width)
d$y <- round(d$y * viewport_dims$height)
d
# Some case where x and y are empty lists...
if (length(d$x) > 0 && length(d$y) > 0) {
d$x <- round(d$x * viewport_dims$width)
d$y <- round(d$y * viewport_dims$height)
d
}
})
}

Expand Down

0 comments on commit fa9918f

Please sign in to comment.