nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.33k stars 1.07k forks source link

Problem with rPivotTable in Shiny #1319

Open jberilo opened 1 year ago

jberilo commented 1 year ago

Hello. Good afternoon. I'm trying to limit the Aggregation and Rendering options in a Shiny app I'm making using rPivotTable. If I don't enter at least two options of each type it doesn't work. How do I get it to work with only one option of Aggregation and Rendering? I'm using the Count and Sum aggregation options. Only Count does not work. In rendering I'm using Table and Table Barchart. Only Table does not work, there is no option.

Here's the piece of code in R.

rpivotTable(data = df2, aggregatorName = "Count", aggregators = list(Count = htmlwidgets::JS('$.pivotUtilities.aggregators["Count"]'), Sum = htmlwidgets::JS('$.pivotUtilities.aggregators["Sum"]')), renderers = list(Table=htmlwidgets::JS('$.pivotUtilities.renderers["Table"]'), TableBarchat=htmlwidgets::JS('$.pivotUtilities.renderers["Table Barchart"]')), rendererName = "Table", onRefresh = htmlwidgets::JS( "function(config) { Shiny.onInputChange('myPivotINT', document.getElementById('myPivotINT').innerHTML); }"))

Can anyone help?

Thanks.