interactive_point_verif: Shiny module for interactively showing point verification...

View source: R/interactive_point_verif.R

interactive_point_verifUIR Documentation

Shiny module for interactively showing point verification scores

Description

Shiny module for interactively showing point verification scores

Usage

interactive_point_verifUI(id)

interactive_point_verif(
  input,
  output,
  session,
  verif_data,
  colour_table,
  time_axis
)

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

colour_table

A reactive data frame in a format suitable for the colour_table argument to plot_point_verif

time_axis

A reactive string giving the name of the time axis to use as the x-axis in the dashboard. Mut be one of "lead_time", "valid_dttm", or "valid_hour" and the column must exist in verif_data.

Value

An interactive list of options chosen for a plot that can be passed to download_verif_plot

Examples

library(shiny)

shinyOptions(theme = "white")

ui <- fluidPage(
  fluidRow(
    column(12, interactive_point_verifUI("int"))
  ),
  fluidRow(
    column(12, verbatimTextOutput("opts"))
  )
)

server <- function(input, output, session) {

  col_tbl <- data.frame(
    fcst_model = unique(verif_data_ens$ens_summary_scores$fcst_model),
    colour     = c("red", "blue")
  )

  opts <- callModule(
    interactive_point_verif, "int", reactive(verif_data_ens),
    reactive(col_tbl),  reactive("lead_time")
  )

  output$opts <- renderPrint({
    req(opts())
  })

}

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

andrew-MET/harpVis documentation built on March 11, 2024, 9:34 a.m.