R/json.R

to_json <- function(x) {
    toObj(toJSON(x))
}

# Solution borrowed from rCharts, thanks ramnathv!
toObj <- function(x){
    res <- gsub('\"#!(.*?)!#\"', "\\1", x)
    #res <- gsub("\\\\", "\\", res)
    res <- shiny:::HTML(res)
    return(res)
}
metagraf/sparkle documentation built on May 22, 2019, 7:49 p.m.