Skip to contents

The UI includes a button with a palette icon for opening a modal to pick colours for a plot. The output is a data frame that can be used to control colours in plotting point verification scores using the plot_point_verif function.

Usage

colour_choicesUI(id)

colour_choices(input, output, session, verif_data)

Arguments

id

An ID string for the module's UI

input

input reactive

output

output reactive

session

Session from which to make a child scope (the default should almost always be used).

verif_data

verification data as a reactive value

Value

A reactive data frame to be used as input to the colour_table

argument in plot_point_verif.

Details

Note that the module uses the "old" semantics for shiny modules so should be called with callModule rather than moduleServer.

Examples

library(shiny)

ui <- fluidPage(
  colour_choicesUI("cols"),
  plotOutput("verifPlot")
)

server <- function(input, output, session) {
  col_table <- callModule(colour_choices, "cols", reactive(verif_data_ens))
  output$verifPlot <- renderPlot({
    plot_point_verif(
      verif_data_ens, spread, colour_table = col_table(),
      plot_num_cases = FALSE
    )
  })
}

if (interactive()) {
  shinyApp(ui, server)
}