Description Usage Arguments Value Examples
View source: R/simpleDisplay_module.R
A shiny Module to display and save plots
display server function
1 2 3 4 5 6 7 8 9 10 11 | simpleDisplayUI(id)
simpleDisplay(
input,
output,
session,
plot_list,
params = reactiveValues(),
save = TRUE,
multirow = FALSE
)
|
id |
shiny id |
input |
shiny input |
output |
shiny output |
session |
shiny session |
plot_list |
a reactivevalues object containing a plot or a list of plots |
params |
reactivevalues object used to initialize plot parameters with the following elements (not mandatory):
|
save |
logical. Add buttons to save plot and plot data? |
multirow |
logical. Allow plots to be displayed on multiple rows? |
a reactivevalues object with:
: the plots displayed
: input parameters. These include events describing user interaction with the plot such as:
: plot brush events
: plot click events
: plot double click events
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 49 50 | ## Not run:
library(shiny)
library(shinydashboard)
library(gridExtra)
library(ggplot2)
library(plotly)
if (interactive()){
ui <- dashboardPage(
dashboardHeader(title = "simpleDisplay"),
sidebar = dashboardSidebar(disable = TRUE),
body = dashboardBody(
fluidRow(
column(12, box(width = NULL, simpleDisplayUI("simple_display_module")))
)
)
)
server <- function(input, output, session) {
params <- reactiveValues(top = "Iris", use_plotly = FALSE)
plot_list <- reactive({
plist <- list()
plist[[1]] <- ggplot(iris, aes(x=Sepal.Length, y = Sepal.Width, color = Species)) +
geom_point(alpha = 0.5) +
facet_wrap(~Species)
plist[[2]] <- ggplot(iris, aes(x=Species, y = Sepal.Length, fill = Species)) +
geom_col(alpha = 0.5)
return(plist)
})
callModule(simpleDisplay, "simple_display_module",
plot_list = plot_list,
params = params,
size = 500)
}
shinyApp(ui, server)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.