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