Commit 20e6f0eb authored by Dorchies David's avatar Dorchies David
Browse files

feat(overview): disable slideInput by default and plot enhancements

parent dee650b6
Pipeline #22572 passed with stage
in 13 minutes and 14 seconds
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#' @noRd #' @noRd
#' #'
#' @importFrom shiny NS tagList #' @importFrom shiny NS tagList
#' @importFrom shinyjs useShinyjs #' @importFrom shinyjs useShinyjs disabled
mod_instant_risk_overview_ui <- function(id){ mod_instant_risk_overview_ui <- function(id){
ns <- NS(id) ns <- NS(id)
choices <- seq(length(rvgest::rulesets$rules)) choices <- seq(length(rvgest::rulesets$rules))
...@@ -42,11 +42,13 @@ mod_instant_risk_overview_ui <- function(id){ ...@@ -42,11 +42,13 @@ mod_instant_risk_overview_ui <- function(id){
fluidRow( fluidRow(
lapply(seq.int(nrow(rvgest::lakes)), function(i) { lapply(seq.int(nrow(rvgest::lakes)), function(i) {
column(width = 3, column(width = 3,
sliderInput(ns(paste0("V", i)), disabled(
label = paste(rvgest::lakes$name[i], "lake (hm3)"), sliderInput(ns(paste0("V", i)),
value = round(getObjectiveStorage()[rvgest::lakes$name[i]]), label = paste(rvgest::lakes$name[i], "lake (hm3)"),
min = rvgest::lakes$min[i], value = round(getObjectiveStorage()[rvgest::lakes$name[i]]),
max = rvgest::lakes$max[i])) min = rvgest::lakes$min[i],
max = rvgest::lakes$max[i]))
)
}) })
), ),
# tableOutput(ns("table")) # tableOutput(ns("table"))
...@@ -98,7 +100,8 @@ mod_instant_risk_overview_server <- function(id, con, SGL_RT_storage) { ...@@ -98,7 +100,8 @@ mod_instant_risk_overview_server <- function(id, con, SGL_RT_storage) {
output$plot <- renderPlot( output$plot <- renderPlot(
ggplot(df(), aes(x = reorder(objective, prob), y = prob)) + ggplot(df(), aes(x = reorder(objective, prob), y = prob)) +
geom_col(aes(fill = level)) + geom_col(aes(fill = level)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) + scale_y_continuous(name = "Failure risk", labels = scales::percent_format(accuracy = 1)) +
scale_x_discrete(name = "Objectives downstream the reservoirs") +
coord_flip()) coord_flip())
}) })
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment