{"action":"created","issue":{"url":"https://api.github.com/repos/jbkunst/highcharter/issues/175","repository_url":"https://api.github.com/repos/jbkunst/highcharter","labels_url":"https://api.github.com/repos/jbkunst/highcharter/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/jbkunst/highcharter/issues/175/comments","events_url":"https://api.github.com/repos/jbkunst/highcharter/issues/175/events","html_url":"https://github.com/jbkunst/highcharter/issues/175","id":175068451,"number":175,"title":"Redrawing multiple highcharts / possible memory leak?","user":{"login":"TJ66","id":21990733,"avatar_url":"https://avatars.githubusercontent.com/u/21990733?v=3","gravatar_id":"","url":"https://api.github.com/users/TJ66","html_url":"https://github.com/TJ66","followers_url":"https://api.github.com/users/TJ66/followers","following_url":"https://api.github.com/users/TJ66/following{/other_user}","gists_url":"https://api.github.com/users/TJ66/gists{/gist_id}","starred_url":"https://api.github.com/users/TJ66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TJ66/subscriptions","organizations_url":"https://api.github.com/users/TJ66/orgs","repos_url":"https://api.github.com/users/TJ66/repos","events_url":"https://api.github.com/users/TJ66/events{/privacy}","received_events_url":"https://api.github.com/users/TJ66/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jbkunst/highcharter/labels/stranger-things","name":"stranger-things","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-05T13:09:17Z","updated_at":"2016-09-06T19:51:31Z","closed_at":"2016-09-06T19:51:31Z","body":"Hello again!\r\n I posted my question in [the original thread issue 37](https://github.com/jbkunst/highcharter/issues/37). But since it is marked as closed I think that it is not the worst idea to open a new issue.\r\nPlease find my original post below.\r\n\r\nHi there! I know that it might be an old topic, but I recently faced some issues regarding the code posted above. Consider an example with the code above, where it is  used in a loop and plots are redrawn lets say every second. In such case I noticed a claiming memory usage in Chorme Task-manager what after a period of time leads to \"Aw Snap something went wrong while displaying this web page\".\r\nFor a minimal example I didn't change much of the code just included invalidateLater into the renderUI function.\r\n\r\n```\r\nlibrary(\"shiny\")\r\n\r\nlibrary(\"highcharter\")\r\n\r\nui <- fluidPage(\r\n  selectInput(\"nplots\", \"Choose\", multiple = TRUE, width = \"100%\",\r\n              choices = c(\"cars\", \"mtcars\", \"iris\",\r\n                          \"Puromycin\", \"ChickWeight\")),\r\n  fluidRow(\r\n    column(12, htmlOutput(\"hcontainer\")),\r\n    highchartOutput(\"hcontainer2\", height = \"0\", width = \"0\")\r\n    # the previous output is hide. This is needed load highcharts/highcharter\r\n    # javascript in the app\r\n  )\r\n)\r\n\r\nserver <- function(input, output) {\r\n  \r\n  gethc <- function(dfname = \"cars\") {\r\n    # function to return the chart in a column div\r\n    df <- get(dfname)\r\n    \r\n    hc <- highchart(height = 300) %>% \r\n      hc_title(text = dfname) %>% \r\n      hc_xAxis(title = list(text = names(df)[1])) %>% \r\n      hc_yAxis(title = list(text = names(df)[2])) %>% \r\n      hc_add_series_scatter(df[,1], df[, 2]) %>% \r\n      hc_add_theme(\r\n        list(hc_theme_538(), hc_theme_economist(), hc_theme_darkunica())[sample(1:3, size = 1)][[1]]\r\n      )\r\n    \r\n    column(width = 6, hc)\r\n    \r\n  }\r\n  \r\n  output$hcontainer <- renderUI({\r\n    invalidateLater(1000)\r\n     input <- list(nplots =  c(\"cars\", \"mtcars\", \"iris\",\r\n                               \"Puromycin\", \"ChickWeight\"))\r\n    charts <- lapply(input$nplots, gethc)\r\n    do.call(tagList, charts)\r\n    \r\n  })  \r\n  \r\n}\r\n\r\n\r\nshinyApp(ui = ui, server = server)\r\n```\r\n\r\n\r\nPlease Let me know if you are able to replicate the issue and off course have suggestions how to get rid of this nasty problem.\r\nGreetings! "},"comment":{"url":"https://api.github.com/repos/jbkunst/highcharter/issues/comments/245068910","html_url":"https://github.com/jbkunst/highcharter/issues/175#issuecomment-245068910","issue_url":"https://api.github.com/repos/jbkunst/highcharter/issues/175","id":245068910,"user":{"login":"jbkunst","id":56481,"avatar_url":"https://avatars.githubusercontent.com/u/56481?v=3","gravatar_id":"","url":"https://api.github.com/users/jbkunst","html_url":"https://github.com/jbkunst","followers_url":"https://api.github.com/users/jbkunst/followers","following_url":"https://api.github.com/users/jbkunst/following{/other_user}","gists_url":"https://api.github.com/users/jbkunst/gists{/gist_id}","starred_url":"https://api.github.com/users/jbkunst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbkunst/subscriptions","organizations_url":"https://api.github.com/users/jbkunst/orgs","repos_url":"https://api.github.com/users/jbkunst/repos","events_url":"https://api.github.com/users/jbkunst/events{/privacy}","received_events_url":"https://api.github.com/users/jbkunst/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T19:51:31Z","updated_at":"2016-09-06T19:51:31Z","body":"Nice! I guess we can close the issue :D.  I think take some time but I guess is due to the many dom elements in higcharts containers."}}
{"actor":{"display_login":"jbkunst"}}