Skip to content

Plotly Graph Download Size Issue #1556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
keeganmcbride opened this issue Jun 26, 2019 · 2 comments
Closed

Plotly Graph Download Size Issue #1556

keeganmcbride opened this issue Jun 26, 2019 · 2 comments

Comments

@keeganmcbride
Copy link

I am creating a Shiny app using Plotly and am seeing some weird behaviour when it comes to downloading/exporting the graph. The code below shows the gist of the app. What happens is, when clicking on the download image button it seems that the height/width don't accurately represent the values. However, if I simply press minimize/maximize on the browser window, the next time one downloads the image it fixes everything. I have also attached two images showing this behaviour.

Server.R

    p <- p +
      labs(x = "", y = ylabel, title = title2)  +    
      theme_minimal() 

    ggplotly(p, tooltip = "text") %>%
      layout(
        legend = list(
          orientation = "h",
          xanchor = "center",
          x = 0.5,
          y = -0.2
        ),
        title = list(font = list(size = 17.5)),
        annotations = list(x = 1, y = 1.05, text = "some text here",
                           showarrow = F, xref='paper', yref='paper', 
                           xanchor='right', yanchor='auto', xshift=0, yshift=0,
                           font=list(size=12, color="#b22f16"))
      ) %>%
      style(legendgroup = NULL) %>%
      config(displaylogo = FALSE,
             modeBarButtonsToRemove = list('lasso2d'))
UI.R
      fluidRow(
        plotlyOutput("output", height = 600) %>% withSpinner(color =
                                                                   "#003951", type = 4))

newplot - 2019-06-26T134118 324 <- Graph that one sees on the screen before minimizing/maximizing window.

newplot - 2019-06-26T134124 417 <- Graph that one sees on the screen after minimizing/maximizing window.

@keeganmcbride
Copy link
Author

keeganmcbride commented Jun 26, 2019

I guess it would be connected to this: plotly/plotly.js#1576 and plotly/plotly.js#3746

@keeganmcbride
Copy link
Author

Nevermind, didn't know this existed:

         toImageButtonOptions = list(
             format = "png",
             width = 1500,
             height = 1000
           ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant