changeMouseMode: Set mouse interaction type

View source: R/scatterPlotMatrix.R

changeMouseModeR Documentation

Set mouse interaction type

Description

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

Usage

changeMouseMode(id, interactionType)

Arguments

id

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

interactionType

Type of mouse interaction.

Value

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

Examples

 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)
 }


scatterPlotMatrix documentation built on June 22, 2024, 10:50 a.m.