Learn R Programming

parallelPlot (version 0.4.0)

getValue: Plot attributes

Description

Asks to retrieve the value of an attribute.

Usage

getValue(id, attrType, valueInputId)

Value

No return value, called from shiny applications for side effects.

Arguments

id

output variable to read from (id which references the requested plot)

attrType

which value is requested.

valueInputId

reactive input to write to.

Details

Available attributes are Cutoffs, SelectedTraces and ReferenceColumn. Result will be sent through a reactive input.

Examples

Run this code
 if(interactive() && require(shiny)) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
     actionButton("getSelectedTracesAction", "Retrieve Selected Lines"),
     p("The button displays the list of uncutted rows (use brush to reduce it)"),
     parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
     output$parPlot <- renderParallelPlot({
       parallelPlot(iris)
     })
     observeEvent(input$getSelectedTracesAction, {
       attributeType <- "SelectedTraces"
       parallelPlot::getValue("parPlot", attributeType, "MySelectedTraces")
     })
     observeEvent(input$MySelectedTraces, {
       showModal(modalDialog(
         title = "Selected Lines",
         toString(input$MySelectedTraces)
       ))
     })
   }

   shinyApp(ui, server)
 }

Run the code above in your browser using DataLab