amVennDiagram-shiny {amVennDiagram5} | R Documentation |
Output and render functions for using amVennDiagram
within Shiny applications and interactive Rmd documents.
amVennDiagramOutput(outputId, width = "100%", height = "400px")
renderAmVennDiagram(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height |
a valid CSS dimension (like |
expr |
an expression that generates an |
env |
the environment in which to evaluate |
quoted |
logical, whether |
amVennDiagramOutput
returns an output element that can be
included in a Shiny UI definition, and renderAmVennDiagram
returns a
shiny.render.function
object that can be included in a Shiny server
definition.
if(require("shiny") && interactive()) {
library(amVennDiagram5)
library(shiny)
sets <- list(A = 1:20, B = 15:38, C = c(0:5, 20, 30:40))
diagram <- makeVennData(sets)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
radioButtons(
"theme", label = "Theme",
choices = c(
"default",
"dark",
"dataviz",
"frozen",
"kelly",
"material",
"moonrise",
"spirited"
)
)
),
mainPanel(
amVennDiagramOutput("diagram", height = "95vh")
)
)
)
server <- function(input, output, session) {
output[["diagram"]] <- renderAmVennDiagram({
amVennDiagram(
diagram, theme = input[["theme"]]
)
})
}
shinyApp(ui, server)
}