R / ShinyApp does not show plot_ly in the browser, but only shows the graph in the view pane

I ran into the same problem that was mentioned in R / Shiny Graphics are not displayed in the browser

But in my case reactivePlot () is not working. He shows

error ie "reactivePlot is deprecated. Use renderPlot instead."

The code does not cause errors. It is working fine. The problem is only displaying the graphical graph in the browser. I tried this in all browsers, the graph is displayed in the view pane, and not in the browser, although if I draw another diagram, such as barplot, it is easily displayed in the browser. I can not solve the problem! Help me out !! Thanks in advance!!!!

+4
source share
1 answer

Just an example of how he solved my problem.

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
   fluidRow(
    box(plotlyOutput("plot1", height = "400px", width = "600px"))   
   )
  )
)
server <- function(input, output) {
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]
output$plot1 <- renderPlotly({
  plot_ly(d, x = ~carat, y = ~price, color = ~carat,
        size = ~carat, text = ~paste("Clarity: ", clarity))    
 })
}
shinyApp(ui = ui, server = server)
+3
source

Source: https://habr.com/ru/post/1664380/


All Articles