R/plotly.R

Defines functions plotly_handler

Documented in plotly_handler

library(base64enc)

#' Handle 'plot.ly' Charts
plotly_handler <- function() {
  return(function (plot, description, params) {
    buf <- charToRaw(plotly::plotly_json(plot, FALSE))
    return(list(data = base64encode(buf), type = "plotly", description = description, params = params))
  })
}
dstackai/dstack-r documentation built on Sept. 25, 2020, 10:12 p.m.