Skip to content

Commit

Permalink
fixed null plotly annotations bug
Browse files Browse the repository at this point in the history
  • Loading branch information
awd97 committed Feb 17, 2022
1 parent 03d0a57 commit 309938d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/seaMass.R
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ setMethod("plot_robust_pca", "seaMass", function(
}

suppressWarnings(fig <- plotly::ggplotly(g, tooltip = c("text", "x", "y"), dynamicTicks = T, width = width, height = height))
for (i in 1:length(fig$x$layout$annotations)) fig$x$layout$annotations[[i]]$y <- fig$x$layout$annotations[[i]]$y - 0.05 # another grim plotly hack
if (!is.null(fig$x$layout$annotations))
for (i in 1:length(fig$x$layout$annotations)) fig$x$layout$annotations[[i]]$y <- fig$x$layout$annotations[[i]]$y - 0.05 # another grim plotly hack

return(fig)
})
Expand Down

0 comments on commit 309938d

Please sign in to comment.