R/show_d3.R

Defines functions show_d3

show_d3 <- function(tmpfile, arguments){
    if(any(names(arguments) == "browser")){
        browser <- eval(arguments$browser)
    } else {
        browser <- FALSE
    }
    htmlFile <- tempfile(fileext=".html")
    cat(tmpfile, file = htmlFile)
    
    viewer <- getOption("viewer")
    if(is.null(viewer) | browser == TRUE) {
        utils::browseURL(htmlFile)
        } else {
            viewer(htmlFile)
            }
}
cddesja/D3plot documentation built on Aug. 3, 2022, 7:39 p.m.