Commit 9c190174 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.8.33 UPDATE: dyplot.default function now uses the functions .startStop...

v0.2.8.33 UPDATE: dyplot.default function now uses the functions .startStop and .dyShadingMulti in order to draw draw several shadows
parent c3a89e1e
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.8.32
Version: 0.2.8.33
Date: 2020-02-14
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.32 Release Notes (2020-02-14)
### 0.2.8.33 Release Notes (2020-02-14)
#### New features
......
......@@ -95,18 +95,9 @@ dyplot.default <- function(x, Qsup = NULL, Qsup.name = "Qsup",
dg <- dygraphs::dyRangeSelector(dygraph = dg, height = 15)
}
if (plot.na) {
naQ_rle <- rle(is.na(data$Qobs))
naQ_ide <- cumsum(naQ_rle$lengths)[naQ_rle$values] + 1
naQ_ids <- naQ_ide - naQ_rle$lengths[naQ_rle$values] - 1
IDna <- data.frame(start = naQ_ids, end = naQ_ide)
IDna$start <- ifelse(IDna$start < 1 , 1 , IDna$start)
IDna$end <- ifelse(IDna$end > nrow(data), nrow(data), IDna$end )
for (i in seq_len(nrow(IDna))) {
dg <- dygraphs::dyShading(dygraph = dg,
from = as.character(data$DatesR)[IDna[i, "start"]],
to = as.character(data$DatesR)[IDna[i, "end" ]],
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) {
dg <- dygraphs::dyRoller(dygraph = dg, rollPeriod = 5)
......
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