{"action":"created","issue":{"url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/6","labels_url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/6/comments","events_url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/6/events","html_url":"https://github.com/timelyportfolio/parcoords/issues/6","id":60904335,"number":6,"title":"in `Shiny` `JS` getting passed as a string","user":{"login":"timelyportfolio","id":837910,"avatar_url":"https://avatars.githubusercontent.com/u/837910?v=3","gravatar_id":"","url":"https://api.github.com/users/timelyportfolio","html_url":"https://github.com/timelyportfolio","followers_url":"https://api.github.com/users/timelyportfolio/followers","following_url":"https://api.github.com/users/timelyportfolio/following{/other_user}","gists_url":"https://api.github.com/users/timelyportfolio/gists{/gist_id}","starred_url":"https://api.github.com/users/timelyportfolio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timelyportfolio/subscriptions","organizations_url":"https://api.github.com/users/timelyportfolio/orgs","repos_url":"https://api.github.com/users/timelyportfolio/repos","events_url":"https://api.github.com/users/timelyportfolio/events{/privacy}","received_events_url":"https://api.github.com/users/timelyportfolio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-03-12T21:15:05Z","updated_at":"2015-03-16T16:59:14Z","closed_at":null,"body":"@jcheng5, @ramnathv, @yihui |  I wondered if you might be able to add some insight on this strange situation.  When using `parcoords`, the `JS_EVALS` get passed as a `character` and fail when rendered with `renderParcoords` in Shiny, but work perfectly even in Shiny when rendered statically with `parcoords`.  Here is a simple example that fails on my machine.  `sessionInfo()` pasted below code.  I'll keep digging but I have not found anything so far.\r\n\r\n```r\r\nlibrary(shiny)\r\nlibrary(parcoords)\r\n\r\np1 <- parcoords(\r\n  mtcars,\r\n  ,color = list(\r\n    colorScale=htmlwidgets::JS('d3.scale.category10()')\r\n    , colorBy = \"cyl\"\r\n  )\r\n)\r\n\r\n# test p1 ; should color by cyl\r\np1\r\n\r\n# JS_evals\r\nhtmlwidgets:::JSEvals(p1$x)\r\n\r\nui <- shinyUI(fluidPage(\r\n  tags$h1(\"shiny\")\r\n  ,parcoordsOutput(\"DiamondPlot\")\r\n  ,tags$h1(\"static\")\r\n  ,p1\r\n))\r\n  \r\nserver <- function(input, output, session) {\r\n  output$DiamondPlot <- renderParcoords({\r\n    p1\r\n  })\r\n}\r\n\r\nshinyApp(ui,server)\r\n```\r\n\r\n```\r\nR version 3.1.2 (2014-10-31)\r\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\r\n\r\nlocale:\r\n[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   \r\n[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          \r\n[5] LC_TIME=English_United States.1252    \r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] parcoords_0.1     shiny_0.11.1.9002\r\n\r\nloaded via a namespace (and not attached):\r\n [1] digest_0.6.4      htmltools_0.2.7   htmlwidgets_0.3.2 httpuv_1.3.2      jsonlite_0.9.14  \r\n [6] mime_0.2          R6_2.0.1          Rcpp_0.11.4.6     RJSONIO_1.3-0     tools_3.1.2      \r\n[11] xtable_1.7-4      yaml_2.1.13 \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/comments/81806998","html_url":"https://github.com/timelyportfolio/parcoords/issues/6#issuecomment-81806998","issue_url":"https://api.github.com/repos/timelyportfolio/parcoords/issues/6","id":81806998,"user":{"login":"jcheng5","id":129551,"avatar_url":"https://avatars.githubusercontent.com/u/129551?v=3","gravatar_id":"","url":"https://api.github.com/users/jcheng5","html_url":"https://github.com/jcheng5","followers_url":"https://api.github.com/users/jcheng5/followers","following_url":"https://api.github.com/users/jcheng5/following{/other_user}","gists_url":"https://api.github.com/users/jcheng5/gists{/gist_id}","starred_url":"https://api.github.com/users/jcheng5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcheng5/subscriptions","organizations_url":"https://api.github.com/users/jcheng5/orgs","repos_url":"https://api.github.com/users/jcheng5/repos","events_url":"https://api.github.com/users/jcheng5/events{/privacy}","received_events_url":"https://api.github.com/users/jcheng5/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T16:59:14Z","updated_at":"2015-03-16T16:59:14Z","body":"> I don't see any reason why `I()` should result in an extra `[]`, but I could be missing something.\r\n\r\nThat's simply how you opt out of auto-unboxing on a per-vector basis in RJSONIO. From `?RJSONIO::toJSON`:\r\n\r\n> Objects of class AsIs in R, i.e. that are enclosed in a call to I() are treated as containers even if\r\nthey are of length 1. This allows callers to indicate the desired representation of an R \"scalar\" as an\r\narray of length 1 in JSON"}}