5

I want to add Plotly chart renderers to the rpivotTable() function from the R package rpivotTable. I followed the instructions given in the Javascript Pivot Table Wiki to add optional extra renderers. Unfortunatey, following these instructions will lead to the default behaviour. Maybe I assigned the Java code to the wrong arguments.

Here is a small example:

library(rpivotTable)
library(shiny)

server <- function(input, output){

  output$mypivot = renderRpivotTable({
    rpivotTable(
      Titanic,
      renderers = htmlwidgets::JS("$.extend($.pivotUtilities.renderers,
            $.pivotUtilities.plotly_renderers)"),
      rendererName = "Horizontal Stacked Bar Chart"
    )
  })
}
ui <- shinyUI(fluidPage(
  tags$head(tags$script(src = "https://cdn.plot.ly/plotly-latest.min.js")),
  rpivotTableOutput("mypivot"))
)

shinyApp(ui = ui, server = server) 
  • 2
    This isn't possible today but we're working on a new rpivotTable release where the plotly renderers would be bundled and this type of thing might work (source: I'm the author of PivotTable.js, a contributor to rpivotTable and a Plotly employee :) – nicolaskruchten Jan 25 '18 at 14:32
  • See the GitHub Issue - https://github.com/smartinsightsfromdata/rpivotTable/issues/89 - created to track this – Eli Berkow Sep 25 '18 at 22:28

0 Answers0