amVennDiagram-shiny {amVennDiagram5}R Documentation

Shiny bindings for 'amVennDiagram'

Description

Output and render functions for using amVennDiagram within Shiny applications and interactive Rmd documents.

Usage

amVennDiagramOutput(outputId, width = "100%", height = "400px")

renderAmVennDiagram(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

a valid CSS dimension (like "100%", "400px", "auto") or a number, which will be coerced to a string and have "px" appended

expr

an expression that generates an amVennDiagram

env

the environment in which to evaluate expr

quoted

logical, whether expr is a quoted expression (with quote()); this is useful if you want to save an expression in a variable

Value

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.

Examples

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)

}

[Package amVennDiagram5 version 1.0.0 Index]