Learn R Programming

scatterPlotMatrix (version 0.3.0)

changeMouseMode: Set mouse interaction type

Description

Three types of mouse interactions are available (tooltip, filter or zoom).

Usage

changeMouseMode(id, interactionType)

Value

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

Arguments

id

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

interactionType

Type of mouse interaction.

Examples

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

   ui <- fluidPage(
     selectInput(
       "mouseMode",
       "Mouse Interactions:",
       c("Tooltip" = "tooltip", "Filter" = "filter", "Zoom" = "zoom")
     ),
     p("Selector controls type of mouse interactions with the scatterPlotMatrix"),
     scatterPlotMatrixOutput("spMatrix")
   )

   server <- function(input, output, session) {
     output$spMatrix <- renderScatterPlotMatrix({
       scatterPlotMatrix(iris)
     })
     observe({
       scatterPlotMatrix::changeMouseMode("spMatrix", input$mouseMode)
     })
   }

   shinyApp(ui, server)
 }

Run the code above in your browser using DataLab