tests/shiny/others.R

#' @description
#' Generate a plotly object including Javascript,
#' which passes the relayout information to \code{Shiny}
plotly_with_relayout = function(){
  js <- "
        function(el, x){
          var id = el.getAttribute('id');
          document.getElementById(id).on('plotly_relayout', function(ev){
            console.log(ev);
            ev['outputId'] = id;
            Shiny.setInputValue(id + '_relayout', ev);
            })
        }
      "

  self$figure %>%
    htmlwidgets::onRender(js)
}

Try the shinyHugePlot package in your browser

Any scripts or data that you put into this service are public.

shinyHugePlot documentation built on Oct. 1, 2024, 5:08 p.m.