From 9e8d792c7347f12fb7cef56793f8e39b2b1935a8 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Sun, 15 Mar 2015 15:07:59 -0500 Subject: [PATCH] fixes timelyportfolio/parcoords#6: make sure data.evals is an array toJSON() in the current development version of shiny will unbox data.evals to a scalar, and we just make sure it is an array on the JavaScript side --- inst/www/htmlwidgets.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inst/www/htmlwidgets.js b/inst/www/htmlwidgets.js index 63f1874f..802bbea6 100644 --- a/inst/www/htmlwidgets.js +++ b/inst/www/htmlwidgets.js @@ -376,6 +376,7 @@ overrideMethod(shinyBinding, "renderValue", function(superfunc) { return function(el, data) { // Resolve strings marked as javascript literals to objects + if (!(data.evals instanceof Array)) data.evals = [data.evals]; for (var i = 0; data.evals && i < data.evals.length; i++) { window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]); } @@ -469,6 +470,7 @@ if (scriptData) { var data = JSON.parse(scriptData.textContent || scriptData.text); // Resolve strings marked as javascript literals to objects + if (!(data.evals instanceof Array)) data.evals = [data.evals]; for (var k = 0; data.evals && k < data.evals.length; k++) { window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]); }