highlightRow {parallelPlot}R Documentation

Row highlight

Description

Asks to change the highlighted row.

Usage

highlightRow(id, rowIndex)

Arguments

id

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

rowIndex

index of the row to highlight; NULL means no row is to highlight.

Value

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

Examples

 if(interactive() && require(shiny)) {
   library(shiny)
   library(parallelPlot)

   ui <- fluidPage(
     actionButton("highlightRowAction", "Highlight Last Row"),
     actionButton("clearHlRowAction", "Remove Highlighting"),
     p("These buttons sets/unsets a selected line"),
     parallelPlotOutput("parPlot")
   )

   server <- function(input, output, session) {
     output$parPlot <- renderParallelPlot({
       parallelPlot(iris)
     })
     observeEvent(input$highlightRowAction, {
       lastRowIndex <- nrow(iris)
       parallelPlot::highlightRow("parPlot", lastRowIndex)
     })

     observeEvent(input$clearHlRowAction, {
       parallelPlot::highlightRow("parPlot", NULL)
     })
   }

   shinyApp(ui, server)
 }


[Package parallelPlot version 0.4.0 Index]