{"action":"opened","issue":{"url":"https://api.github.com/repos/juba/scatterD3/issues/8","labels_url":"https://api.github.com/repos/juba/scatterD3/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/juba/scatterD3/issues/8/comments","events_url":"https://api.github.com/repos/juba/scatterD3/issues/8/events","html_url":"https://github.com/juba/scatterD3/issues/8","id":109544197,"number":8,"title":"Overlapping Plots in Shiny scatterD3 ","user":{"login":"tinyheero","id":3268173,"avatar_url":"https://avatars.githubusercontent.com/u/3268173?v=3","gravatar_id":"","url":"https://api.github.com/users/tinyheero","html_url":"https://github.com/tinyheero","followers_url":"https://api.github.com/users/tinyheero/followers","following_url":"https://api.github.com/users/tinyheero/following{/other_user}","gists_url":"https://api.github.com/users/tinyheero/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyheero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyheero/subscriptions","organizations_url":"https://api.github.com/users/tinyheero/orgs","repos_url":"https://api.github.com/users/tinyheero/repos","events_url":"https://api.github.com/users/tinyheero/events{/privacy}","received_events_url":"https://api.github.com/users/tinyheero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-02T18:16:21Z","updated_at":"2015-10-02T18:16:21Z","closed_at":null,"body":"Hi,\r\n\r\nI just installed the latest version from github (@74d6d1f) and there appears to be an issue with the rendering of the scatterD3 when the input data changes in a Shiny App. I've provided an example:\r\n\r\n```{r}\r\nlibrary(\"shiny\")\r\nlibrary(\"scatterD3\")\r\nlibrary(\"dplyr\")\r\nlibrary(\"magrittr\")\r\n\r\n#---------\r\n# Shiny\r\n#---------\r\n\r\nui <- shinyUI(fluidPage(\r\n  titlePanel(\"ScatterD3 Shiny Test\"),\r\n\r\n  sidebarLayout(\r\n    sidebarPanel(\"Sidepanel Test\",\r\n      selectInput(\"cyl\", label = \"cyl\",\r\n                    choices = as.list(c(4, 6, 8)),\r\n                    selected = 4)),\r\n\r\n    mainPanel(scatterD3Output(\"scatterD3.plot\"))\r\n  )\r\n))\r\n\r\nserver <- function(input, output) {\r\n  output$scatterD3.plot <- renderScatterD3({\r\n    mtcars %>%\r\n      filter(cyl == input$cyl) %$%\r\n      scatterD3(x = wt, y = mpg)\r\n  })\r\n}\r\n\r\nshinyApp(ui, server)\r\n```\r\n\r\nWhen you switch cyl values, it appears to just render the plot right on top of the other plot:\r\n\r\n<img width=\"1262\" alt=\"screen shot 2015-10-02 at 11 14 00 am\" src=\"https://cloud.githubusercontent.com/assets/3268173/10254163/c6eed10a-68f6-11e5-8045-182b2a92121d.png\">\r\n\r\n```{r}\r\ndevtools::session_info()\r\nSession info ------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n setting  value\r\n version  R version 3.2.2 (2015-08-14)\r\n system   x86_64, darwin14.5.0\r\n ui       X11\r\n language (EN)\r\n collate  en_CA.UTF-8\r\n tz       America/Vancouver\r\n\r\nPackages ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n  package     * version date       source\r\n assertthat    0.1     2013-12-06 CRAN (R 3.2.2)\r\n colorout    * 1.1-1   2015-08-29 local\r\n curl          0.9.3   2015-08-25 CRAN (R 3.2.2)\r\n DBI           0.3.1   2014-09-24 CRAN (R 3.2.2)\r\n devtools      1.8.0   2015-05-09 CRAN (R 3.2.2)\r\n digest        0.6.8   2014-12-31 CRAN (R 3.2.2)\r\n dplyr       * 0.4.3   2015-09-01 CRAN (R 3.2.2)\r\n git2r         0.11.0  2015-08-12 CRAN (R 3.2.2)\r\n htmltools     0.2.6   2014-09-08 CRAN (R 3.2.2)\r\n htmlwidgets   0.5     2015-06-21 CRAN (R 3.2.2)\r\n httpuv        1.3.3   2015-08-04 CRAN (R 3.2.2)\r\n jsonlite      0.9.17  2015-09-06 CRAN (R 3.2.2)\r\n lazyeval      0.1.10  2015-01-02 CRAN (R 3.2.2)\r\n magrittr    * 1.5     2014-11-22 CRAN (R 3.2.2)\r\n memoise       0.2.1   2014-04-22 CRAN (R 3.2.2)\r\n mime          0.3     2015-03-29 CRAN (R 3.2.2)\r\n R6            2.1.1   2015-08-19 CRAN (R 3.2.2)\r\n Rcpp          0.12.1  2015-09-10 CRAN (R 3.2.2)\r\n rversions     1.0.2   2015-07-13 CRAN (R 3.2.2)\r\n scatterD3   * 0.2     2015-10-02 Github (juba/scatterD3@74d6d1f)\r\n setwidth    * 1.0-4   2015-07-07 CRAN (R 3.2.2)\r\n shiny       * 0.12.2  2015-08-05 CRAN (R 3.2.2)\r\n vimcom      * 1.2-6   2015-09-07 local\r\n xml2          0.1.1   2015-06-02 CRAN (R 3.2.2)\r\n xtable        1.7-4   2014-09-12 CRAN (R 3.2.2)\r\n yaml          2.1.13  2014-06-12 CRAN (R 3.2.2)\r\n```"}}