From 69b0dd4f1f6ab22fa8466f5544bcf5569de13f60 Mon Sep 17 00:00:00 2001 From: avsdev-cw Date: Wed, 14 Nov 2018 12:41:37 +0000 Subject: [PATCH 1/2] Fix to the renderers and aggregators parameters. This isn't an ideal fix as it relies on the evaluation of a string encoded JSON object, however it now allows code similar to the following to be used: ` rpivotTable(..., renderers = '{"Table": $.pivotUtilities.renderers["Table"]}') --- inst/htmlwidgets/rpivotTable.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inst/htmlwidgets/rpivotTable.js b/inst/htmlwidgets/rpivotTable.js index e3c7e82..bab64ce 100755 --- a/inst/htmlwidgets/rpivotTable.js +++ b/inst/htmlwidgets/rpivotTable.js @@ -34,6 +34,13 @@ HTMLWidgets.widget({ x.params.dataClass = $.pivotUtilities.SubtotalPivotData; } + if (Array.isArray(x.params.aggregators) && x.params.aggregators.length == 1) { + x.params.aggregators = Function('"use strict";return (' + x.params.aggregators[0] + ')')() + } + if (Array.isArray(x.params.renderers) && x.params.renderers.length == 1) { + x.params.renderers = Function('"use strict";return (' + x.params.renderers[0] + ')')() + } + $('#'+el.id).pivotUI(x.data, x.params, true, x.locale); } }); From 732c45e51db249d88a98220b7c0f72f0814d0cf5 Mon Sep 17 00:00:00 2001 From: avsdev-cw Date: Wed, 14 Nov 2018 13:10:31 +0000 Subject: [PATCH 2/2] Bump version for dev build --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 043ebca..cd55bdd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rpivotTable Title: Build Powerful Pivot Tables and Dynamically Slice & Dice your Data Date: 2018-01-29 -Version: 0.3.0 +Version: 0.3.1002 Authors@R: c( person("Enzo", "Martoglio", role = c("aut", "cre"), email = "enzo@smartinsightsfromdata.com"), person("Nicolas", "Kruchten", role = c("ctb", "cph"), email = "nicolas@kruchten.com"),