This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handle_hover_callback <- function(x, model) | |
| UseMethod("handle_hover_callback", x) | |
| handle_hover_callback.character <- function(x, model) { | |
| list( | |
| code = x, | |
| args = list(hover = model$ref) | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # - create a HoverTool model | |
| # - need to point to glyph | |
| # add ref to plot$attributes$tools | |
| # add model to object | |
| ## this is only used internally | |
| ## users cannot manually add a hover tool | |
| ## it must be done through the hover argument to the layer functions | |
| add_hover <- function(fig, tooltips, renderer_ref) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("shiny") | |
| library("rbokeh") | |
| p <- print_model_json | |
| callback = shiny_callback("hoverInfo") | |
| options(hoverCallback=callback) | |
| D <- data.frame(x=1:3,y=runif(3)) | |
| ui <- fluidPage( | |
| rbokehOutput("rbokeh", width = 500, height = 540), | |
| textOutput("x_range_text"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| TFILE="/tmp/$$.R" | |
| cat << EOF > $TFILE | |
| args = (commandArgs(trailingOnly=TRUE))[-1] | |
| cran <- c() | |
| gh <- c() | |
| CRAN <- FALSE;GH <- FALSE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RHIPE = terralib.includecstring [[ | |
| #include <R.h> | |
| #include <Rinternals.h> | |
| #include <Rmath.h> | |
| SEXP counter(SEXP ); | |
| SEXP status(SEXP ); | |
| SEXP collect(SEXP ,SEXP ); | |
| SEXP collect_buffer(SEXP ,SEXP ); | |
| ]] | |
| os = require("os") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| options(rbokehViewDir = "~/public_html/tmp/rbokeh") | |
| options(viewer = (function(){ | |
| first <- TRUE | |
| function(u,height){ | |
| rbokehdir <- getOption("rbokehViewDir") | |
| for(k in list.files(dirname(u),full=TRUE)){ | |
| file.copy(k, rbokehdir, overwrite=TRUE,recursive=TRUE) | |
| } | |
| index_html <- file.path(rbokehdir, "index.html") | |
| message(sprintf("Viewing figure at %s", index_html)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## In https://github.com/rstudio/htmltools/blob/master/R/html_print.R#L41 | |
| ## html_print doesn't have an option on how and where to write the html | |
| ## it always creates anothe temporary directory and writes the HTML there | |
| ## This bypasses that with an uglry recursive copy ... | |
| options(rbokehViewDir = tempfile("rbokehviz")) | |
| if(!file.exists(getOption("rbokehViewDir"))) | |
| dir.create(getOption("rbokehViewDir")) | |
| ## On my remote system, i have a public_html/tmp folder setup that i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## In https://github.com/rstudio/htmltools/blob/master/R/html_print.R#L41 | |
| ## html_print doesn't have an option on how and where to write the html | |
| ## it always creates anothe temporary directory and writes the HTML there | |
| ## This bypasses that with an uglry recursive copy ... | |
| options(rbokehViewDir = tempfile("rbokehviz")) | |
| if(!file.exists(getOption("rbokehViewDir"))) | |
| dir.create(getOption("rbokehViewDir")) | |
| ## On my remote system, i have a public_html/tmp folder setup that i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## In https://github.com/rstudio/htmltools/blob/master/R/html_print.R#L41 | |
| ## html_print doesn't have an option on how and where to write the html | |
| ## it always creates anothe temporary directory and writes the HTML there | |
| ## This bypasses that with an uglry recursive copy ... | |
| options(rbokehViewDir = tempfile("rbokehviz")) | |
| if(!file.exists(getOption("rbokehViewDir"))) | |
| dir.create(getOption("rbokehViewDir")) | |
| ## On my remote system, i have a public_html/tmp folder setup that i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## In https://github.com/rstudio/htmltools/blob/master/R/html_print.R#L41 | |
| ## html_print doesn't have an option on how and where to write the html | |
| ## it always creates anothe temporary directory and writes the HTML there | |
| ## This bypasses that with an uglry recursive copy ... | |
| options(rbokehViewDir = tempfile("rbokehviz")) | |
| if(!file.exists(getOption("rbokehViewDir"))) | |
| dir.create(getOption("rbokehViewDir")) | |
| options(viewer = (function(){ |