fitWindow | R Documentation |
Adjust the visible window such that it fits all items
fitWindow(id, options)
id |
graph2d id or a |
options |
Named list of options controlling the animation. Most common
option is |
None, side-effect is Javascript call
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
linevisOutput("graph2d"),
actionButton("btn", "Fit all items")
),
server = function(input, output) {
output$graph2d <- renderLinevis(
linevis(data.frame(
start = c(Sys.Date(), Sys.Date() - 1), content = c("1", "2")
))
)
observeEvent(input$btn, {
fitWindow("graph2d", list(animation = FALSE))
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.