En raison d'une défaillance matérielle, les jobs d'intégration continue peuvent échouer sans raison évidente sur les runners partagés. Les disques incriminés devraient être changés en fin de semaine. Merci de votre compréhension.

Commit df5c3b42 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.8.68 NEW: draw Psol and Pliq on the precip time series plot of th model...

v0.2.8.68 NEW: draw Psol and Pliq on the precip time series plot of th model diagram panel of the GUI when CemaNeige is used
parent 6f76419c
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.8.67
Version: 0.2.8.68
Date: 2020-02-27
Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -4,7 +4,7 @@
### 0.2.8.67 Release Notes (2020-02-26)
### 0.2.8.68 Release Notes (2020-02-26)
#### New features
......
......@@ -653,16 +653,26 @@ shinyServer(function(input, output, session) {
if (length(getSim()$SIM$OutputsModel$DatesR) < 2) {
return(NULL)
}
data <- data.frame(DatesR = getSim()$SIM$OutputsModel$DatesR,
precip. = getSim()$SIM$OutputsModel$Precip)
# data <- getData()$Tab[, c("DatesR", "precip.")]
data <- data.frame(DatesR = getSim()$SIM$OutputsModel$DatesR)
if (grepl("CemaNeige", getSim()$SIM$TypeModel)) {
data$Psol <- rowMeans(sapply(getSim()$SIM$OutputsModel$CemaNeigeLayers, function(x) x$Psol))
data$Pliq <- rowMeans(sapply(getSim()$SIM$OutputsModel$CemaNeigeLayers, function(x) x$Pliq))
Plim <- c(-1e-3, max(data$Psol+data$Pliq, na.rm = TRUE))
col.Precip = c("#428BCA", "lightblue")
} else {
data$Precip <- getSim()$SIM$OutputsModel$Precip
Plim <- c(-1e-3, max(data$Precip, na.rm = TRUE))
col.Precip <- c("#428BCA")
}
data.xts <- xts::xts(data[, -1L, drop = FALSE], order.by = data$DatesR, tzone = "UTC")
dgMDp <- dygraphs::dygraph(data.xts, group = "mod_diag", ylab = paste0("precip. [mm/", getPrep()$TMGR$TimeUnit, "]"))
dgMDp <- dygraphs::dyOptions(dgMDp, colors = "#428BCA", drawXAxis = FALSE,
dgMDp <- dygraphs::dyOptions(dgMDp, colors = col.Precip, drawXAxis = FALSE,
retainDateWindow = FALSE, useDataTimezone = TRUE)
dgMDp <- dygraphs::dyBarSeries(dgMDp, name = "precip.")
dgMDp <- dygraphs::dyAxis(dgMDp, name = "y", valueRange = c(max(data.xts[, "precip."], na.rm = TRUE), -1e-3))
dgMDp <- dygraphs::dyStackedBarGroup(dgMDp, name = rev(grep("^P", colnames(data.xts), value = TRUE)),
axis = "y", color = (col.Precip))
dgMDp <- dygraphs::dyAxis(dgMDp, name = "y", valueRange = rev(Plim))
dgMDp <- dygraphs::dyEvent(dgMDp, input$Event, color = "orangered")
dgMDp <- dygraphs::dyLegend(dgMDp, show = "onmouseover", width = 225)
dgMDp <- dygraphs::dyCrosshair(dgMDp, direction = "vertical")
......
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