View source: R/colour_choices.R
colour_choicesUI | R Documentation |
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.
colour_choicesUI(id)
colour_choices(input, output, session, verif_data)
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 |
Note that the module uses the "old" semantics for shiny modules so should be
called with callModule
rather than
moduleServer
.
A reactive data frame to be used as input to the colour_table
argument in plot_point_verif
.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.