4

Is there a way to remove/hide the 'Edit Chart' link that appears in the bottom right half of your graph in the R version of Plotly?

Thor
  • 41
  • 1
  • 4

3 Answers3

13

From the documentation, use config:

Plotly object p

p %>%
config(showLink = F)

You can see .js config options in action here.

Note: the "save and edit plot in cloud" button in the Mode Bar at the top still exists. You can turn off the Mode Bar with

config(displayModeBar = F)

There is a request on GitHub to edit specific Mode Bar buttons.

Vance Lopez
  • 1,338
  • 10
  • 21
  • 1
    So I tried this and it worked in my Rstudio viewer and when I save it as an html file but when I save it to my plotly account, the modebar appears once more. This is also the case for when I embed the plot into html say on my personal website for example, any idea whats going on? – Cyrus Mohammadian Aug 04 '16 at 07:48
2

Just to add to Sam's fix (thanks!), there is a typo, I had to use ...

 tags$head(
    tags$style(HTML('a[data-title="Save and edit plot in cloud"]{display:none;}'))
) 

Note the capital "S" on "Save.

dividor
  • 95
  • 6
  • I actually think there's a coding error in the background producing the plot, so depending on the graph it shows up as either capitalized or non-capitalized. – Sam Helmich Mar 08 '16 at 14:39
1

It can be done using CSS. Here an an example of it being done in a shiny application.

library(shiny)
library(plotly)
ui <- fluidPage( 
  tags$head(
    tags$style(HTML('a[data-title="save and edit plot in cloud"]{display:none;}'))
 ),
  plotlyOutput(outputId = "plot")
)

server <- function(input, output){
  output$plot <- renderPlotly({

plot_ly(type = "scatter",
        x = rnorm(10),
        y = rnorm(10),
        mode = "markers")
  })
}

shinyApp(ui, server)

I'm not sure how to remove it elsewhere or if there's an argument to turn it off, but this is how I do it.

Sam Helmich
  • 949
  • 1
  • 8
  • 18