Latest version of polar plots not working?

Hey folks -

I’m unable to get plot type “scatterpolar” to work in shiny (either locally or when deployed to shinyio. I get this error message:

Warning: Error in : Trace type must be one of the following:
‘scatter’, ‘box’, ‘bar’, ‘heatmap’, ‘histogram’, ‘histogram2d’, ‘histogram2dcontour’, ‘pie’, ‘contour’, ‘scatterternary’, ‘sankey’, ‘scatter3d’, ‘surface’, ‘mesh3d’, ‘scattergeo’, ‘choropleth’, ‘scattergl’, ‘pointcloud’, ‘heatmapgl’, ‘parcoords’, ‘scattermapbox’, ‘carpet’, ‘scattercarpet’, ‘contourcarpet’, ‘ohlc’, ‘candlestick’, ‘area’

I checked and I am on the latest version of plotly (i.e., 4.7.1) - any ideas or anyone else having the same issue?

Thanks!

1 Like

Hey @sammyhafs

The below code works for me on 4.7.1.900. Perhaps, try the dev version devtools::install_github("ropensci/plotly").

library(shiny)
library(plotly)

ui <- fluidPage(
  plotlyOutput("plot"),
  verbatimTextOutput("event")
)

server <- function(input, output) {
  
  output$plot <- renderPlotly({
    plot_ly(
      type = 'scatterpolar',
      r = c(0,1,2,2),
      theta = c(0,45,90,0),
      mode = 'markers'
    )
  })
  
  output$event <- renderPrint({
    d <- event_data("plotly_hover")
    if (is.null(d)) "Hover on a point!" else d
  })
}

shinyApp(ui, server)

I have the exact same problem with the examples from plot.ly/r/polar-chart/ in RStudio and Version 4.7.1

1 Like

Hey @broen

see explanation here Radarchart Trace Error

@sammyhafs

same issue + 1;
if I update to 4.8, or under 4.7, it do not find the ‘scatterpolar’ option in type argument.