Black Lives Matter. Please consider donating to Black Girls Code today.

Ggplotly Plots No Longer Interactive (Sort Of)

I recently started using Chart Studio to host plotly objects created in RStudio so I can embed them in a website. Not wanting to learn plotly syntax, I used ggplotly() to convert ggplot2 objects to plotly objects, and it worked quite well. Recently, however, the interactive nature of any plots created with ggplotly()have lost the ability to zoom using the zoom tool, pan using the pan tool, or display tooltips in Chart Studio, and therefore on my website. In RStudio, these plots render in the plot pane with all features working properly, but once I upload them to Chart Studio using api_create(), I lose the interactive features mentioned above. I can still pan the plot by dragging my cursor over the axes outside of the plot body and zoom using the “Zoom In” and “Zoom Out” buttons, but anything that requires clicking on or hovering over the plot body does not work. If you would like to check out an example, here is a link to one of the plots. I’ve tried multiple browsers in Ubuntu and Windows, and nothing works. Because everything still works correctly in RStudio, I have to assume something recently changed in Chart Studio. Can anyone provide any insight to why this is happening, and if plotly objects created using ggplotly() will be functional again at some point in the future? Thank you for any information you can provide.

Hmm this is indeed strange! Do you have a sense of when this started? Had you recently reinstalled or upgraded the Plotly library? Does this apply to plots created only as of recently or does this seem to retroactively apply to plots created a while ago that worked before?

The last time I saw it working correctly was April 22 or 23, and I didn’t discover that it wasn’t working until last night. I had not recently upgraded the Plotly library, though last night I tried upgrading to using install_github()then reproducing the plots and uploading them to Chart Studio, but to no avail. I had not changed the plots that were uploaded as of April 22 or 23 between then and last night, so this issue is affecting plots that were uploaded both before and after the issue started for me, and with different versions of Plotly. Thank you for your response. If I can provide any other information, please let me know!

OK, thanks for all that info, I think I know what’s going on here and we should be able to fix it… I’ll give an update here when we have a plan :slight_smile:

Basically the issue is this:

For some reason, ggplotly() adds an invisible shape on your plot, and in the current version of Plotly.js, which is running on Chart Studio, this shape prevents pan/zoom. Hold tight, we’ll fix Plotly.js and redeploy it to Chart Studio in a few days.

Wow, thank you! That was an impressive turnaround time. I really appreciate the help!