R/plot_dynamic.R

Defines functions plot_dynamic

plot_dynamic <- function(p) {
    p2 <- ggplotly(p) %>%
        plotly::config(
            editable = TRUE,
            displaylogo = FALSE,
            edits = list(shapePosition = FALSE),
            modeBarButtons = list(list("toImage")),
            toImageButtonOptions = list(
                filename = "tcga_plot.png",
                format = "png",
                width = 1000,
                height = 1000
            )
        ) %>%
        layout(margin = list(t = 100, r = 100))
    p2$x$layout$annotations[[2]]$x <- -0.075
    return(p2)
}

Try the tcgaViz package in your browser

Any scripts or data that you put into this service are public.

tcgaViz documentation built on April 4, 2023, 5:14 p.m.