Commit 38db2aae authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.8.42 UPDATE: .startStop and .dyShadingMulti renamed .StartStop and .DyShadingMulti

parent 565d8516
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.8.41
Version: 0.2.8.42
Date: 2020-02-26
Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -34,8 +34,8 @@ export(ShinyGR)
export(as.data.frame.airGRt)
exportPattern(".DiagramGR")
exportPattern(".TypeModelGR")
exportPattern(".startStop")
exportPattern(".dyShadingMulti")
exportPattern(".StartStop")
exportPattern(".DyShadingMulti")
......
......@@ -4,7 +4,7 @@
### 0.2.8.41 Release Notes (2020-02-26)
### 0.2.8.42 Release Notes (2020-02-26)
#### New features
......
......@@ -29,7 +29,7 @@ if (getRversion() >= "2.15.1") {
## function to compute the start and stop id of equal values in a vector
## =================================================================================
.startStop <- function(x, FUN) {
.StartStop <- function(x, FUN) {
naQ_rle <- rle(FUN(x))
naQ_ide <- cumsum(naQ_rle$lengths)[naQ_rle$values] + 1
naQ_ids <- naQ_ide - naQ_rle$lengths[naQ_rle$values] - 1
......@@ -46,7 +46,7 @@ if (getRversion() >= "2.15.1") {
## function for drawing several shadows of dygraphic regions simultaneously
## =================================================================================
.dyShadingMulti <- function(dygraph, ts, idStart, IdStop, ...) {
.DyShadingMulti <- function(dygraph, ts, idStart, IdStop, ...) {
for (i in seq_along(idStart)) {
dygraph <- dygraphs::dyShading(dygraph = dygraph,
from = as.character(ts)[idStart[i]],
......
......@@ -95,8 +95,8 @@ dyplot.default <- function(x, Qsup = NULL, Qsup.name = "Qsup",
dg <- dygraphs::dyRangeSelector(dygraph = dg, height = 15)
}
if (plot.na) {
idNA <- .startStop(data$Qobs, FUN = is.na)
dg <- .dyShadingMulti(dygraph = dg, color = col.na,
idNA <- .StartStop(data$Qobs, FUN = is.na)
dg <- .DyShadingMulti(dygraph = dg, color = col.na,
ts = data$DatesR, idStart = idNA$start, IdStop = idNA$stop)
}
if (Roller) {
......
......@@ -544,8 +544,8 @@ shinyServer(function(input, output, session) {
dgTSe <- dygraphs::dyLegend(dgTSe, show = "onmouseover", width = 225)
dgTSe <- dygraphs::dyCrosshair(dgTSe, direction = "vertical")
dgTSe <- dygraphs::dyLimit(dgTSe, limit = 0, color = "blue")
idNA <- .startStop(data$Error, FUN = is.na)
dgTSe <- .dyShadingMulti(dygraph = dgTSe, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
idNA <- .StartStop(data$Error, FUN = is.na)
dgTSe <- .DyShadingMulti(dygraph = dgTSe, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
ts = data$DatesR, idStart = idNA$start, IdStop = idNA$stop)
})
......@@ -630,8 +630,8 @@ shinyServer(function(input, output, session) {
}
dgSVq <- dygraphs::dyCrosshair(dgSVq, direction = "vertical")
dgSVq <- dygraphs::dyLegend(dgSVq, show = "always", width = 325)
idNA <- .startStop(getData()$Tab$Qobs, FUN = is.na)
dgSVq <- .dyShadingMulti(dygraph = dgSVq, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
idNA <- .StartStop(getData()$Tab$Qobs, FUN = is.na)
dgSVq <- .DyShadingMulti(dygraph = dgSVq, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
ts = data$DatesR, idStart = idNA$start, IdStop = idNA$stop)
})
......@@ -715,8 +715,8 @@ shinyServer(function(input, output, session) {
dgMDq <- dygraphs::dySeries(dgMDq, name = "QsimOld", label = "Qold", drawPoints = FALSE, strokePattern = "dashed")
dgMDq <- dygraphs::dyLegend(dgMDq, show = "onmouseover", width = 225)
dgMDq <- dygraphs::dyCrosshair(dgMDq, direction = "vertical")
idNA <- .startStop(data$Qobs, FUN = is.na)
dgMDq <- .dyShadingMulti(dygraph = dgMDq, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
idNA <- .StartStop(data$Qobs, FUN = is.na)
dgMDq <- .DyShadingMulti(dygraph = dgMDq, color = rgb(0.5, 0.5, 0.5, alpha = 0.4),
ts = data$DatesR, idStart = idNA$start, IdStop = idNA$stop)
})
......
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