Description Usage Arguments Examples
Widget output function for use in Shiny
1 | rbokehOutput(outputId, width = "100%", height = "400px")
|
outputId |
output variable to read from |
width |
a valid CSS unit for the width or a number, which will be coerced to a string and have "px" appended. |
height |
a valid CSS unit for the height or a number, which will be coerced to a string and have "px" appended. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ## Not run:
library("shiny")
library("rbokeh")
ui <- fluidPage(
rbokehOutput("rbokeh")
)
server <- function(input, output, session) {
output$rbokeh <- renderRbokeh({
# Use invalidateLater() and jitter() to add some motion
invalidateLater(1000, session)
figure() %>%
ly_points(jitter(cars$speed), jitter(cars$dist))
})
}
shinyApp(ui, server)
library("shiny")
library("rbokeh")
ui <- fluidPage(
rbokehOutput("rbokeh", width = 500, height = 540),
textOutput("x_range_text")
)
server <- function(input, output, session) {
output$rbokeh <- renderRbokeh({
figure() %>% ly_points(1:10) %>%
x_range(callback = shiny_callback("x_range"))
})
output$x_range_text <- reactive({
xrng <- input$x_range
if(!is.null(xrng)) {
paste0("factors: ", xrng$factors, ", start: ", xrng$start,
", end: ", xrng$end)
} else {
"waiting for axis event..."
}
})
}
shinyApp(ui, server)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.