smartinsightsfromdata / rpivotTable

A R wrapper for the great library pivottable
Other
285 stars 71 forks source link

rpivotTable does not render in shiny dashboard app or in shiny server #90

Open ADometrius opened 6 years ago

ADometrius commented 6 years ago

I can render the pivot table outside of shiny just fine, but when attempting to render inside of my shiny app or on an app via shiny server, nothing renders on the page. Is there a known conflict with my versions: R 3.5.0, shiny 1.1.0, shinydashboard 0.7.0, htmlwidgets 1.2, rpivotTable 0.3.0 (Shiny server is using R version 3.4.4 ).

As a note, this is a rather large shiny app and everything else seems to work except the rpivotTable. Other libraries imported into the app: dplyr, lubridate, ggplot2, reshape2, httr, curl, jsonlite, qdapTools, tidyr, scales, ggrepel, stringr, forecast, RMySQL, DT, shinyjs, shinycssloaders

ui.R snipet:

tabItem("incons",
              fluidRow(
                rpivotTable::rpivotTableOutput("myPT.pt")
              )
              ),

server.R snipet:

output$myPT.pt <- rpivotTable::renderRpivotTable({
      rpivotTable::rpivotTable(df, rows = c("Cluster", "Node"), cols = "Key", aggregatorName = "List Unique Values", vals = "Value", rendererName = "Table")
    })
ADometrius commented 6 years ago

This is driving me crazy. I can't seem to figure the issue out... If I run the pivot table by itself it works fine, but when I run the app I get no errors, and no pivot table. I even recreated the pivot table in a new app and it runs fine (I need it to be a part of a much larger app that I have built).

Any thoughts?? Issues with other packages or css issues I should watch out for?

smartinsightsfromdata commented 6 years ago

It would be best if you could provide a reproducible example.

From my past experience, there have been issues when certain libraries had different versions of some shiny libraries (e.g. jquery-ui or jquery). Any htmlwidgets by design loads these components. All is well when they are aligned, but problems may arise when they are not.

Sadly this means going by exclusion on any R package that may use these components (I remember we had problems with ggvis for a while).

Hence the usefulness of a reproducible example.

ADometrius commented 6 years ago

How would I go about comparing the different versions of libraries? This is part of a pretty large app so creating a reprex is going to be very difficult. I am working on process of elimination via 2 different directions: Removing libraries 1 by 1 from the app to see if that makes any difference Created a second app that contains only the rpivottable functionality and I am slowly adding libraries to it to see which one breaks it.

So far, neither approach has made a difference.

mhismail commented 5 years ago

Not sure if this issue is related, but I was having a similar problem where the pivot table was not displaying. Taking the period out of the name fixed the problem for me.

SaJaToGu commented 3 years ago

mhismail is right. That was also the problem with me. I'm using the function make.names which generates '.' dots for the shiny namespace id's in case I there are white space characters. This leads to the blackout of the rpivotTables. Can this be avoided within the code of the package?