Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGRteaching
Commits
38db2aae
Commit
38db2aae
authored
Feb 26, 2020
by
Delaigue Olivier
Browse files
v0.2.8.42 UPDATE: .startStop and .dyShadingMulti renamed .StartStop and .DyShadingMulti
parent
565d8516
Changes
6
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
38db2aae
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.8.4
1
Version: 0.2.8.4
2
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"),
...
...
NAMESPACE
View file @
38db2aae
...
...
@@ -34,8 +34,8 @@ export(ShinyGR)
export(as.data.frame.airGRt)
exportPattern(".DiagramGR")
exportPattern(".TypeModelGR")
exportPattern(".
s
tartStop")
exportPattern(".
d
yShadingMulti")
exportPattern(".
S
tartStop")
exportPattern(".
D
yShadingMulti")
...
...
NEWS.md
View file @
38db2aae
...
...
@@ -4,7 +4,7 @@
### 0.2.8.4
1
Release Notes (2020-02-26)
### 0.2.8.4
2
Release Notes (2020-02-26)
#### New features
...
...
R/Utils.R
View file @
38db2aae
...
...
@@ -29,7 +29,7 @@ if (getRversion() >= "2.15.1") {
## function to compute the start and stop id of equal values in a vector
## =================================================================================
.
s
tartStop
<-
function
(
x
,
FUN
)
{
.
S
tartStop
<-
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
## =================================================================================
.
d
yShadingMulti
<-
function
(
dygraph
,
ts
,
idStart
,
IdStop
,
...
)
{
.
D
yShadingMulti
<-
function
(
dygraph
,
ts
,
idStart
,
IdStop
,
...
)
{
for
(
i
in
seq_along
(
idStart
))
{
dygraph
<-
dygraphs
::
dyShading
(
dygraph
=
dygraph
,
from
=
as.character
(
ts
)[
idStart
[
i
]],
...
...
R/dyplot.default.R
View file @
38db2aae
...
...
@@ -95,8 +95,8 @@ dyplot.default <- function(x, Qsup = NULL, Qsup.name = "Qsup",
dg
<-
dygraphs
::
dyRangeSelector
(
dygraph
=
dg
,
height
=
15
)
}
if
(
plot.na
)
{
idNA
<-
.
s
tartStop
(
data
$
Qobs
,
FUN
=
is.na
)
dg
<-
.
d
yShadingMulti
(
dygraph
=
dg
,
color
=
col.na
,
idNA
<-
.
S
tartStop
(
data
$
Qobs
,
FUN
=
is.na
)
dg
<-
.
D
yShadingMulti
(
dygraph
=
dg
,
color
=
col.na
,
ts
=
data
$
DatesR
,
idStart
=
idNA
$
start
,
IdStop
=
idNA
$
stop
)
}
if
(
Roller
)
{
...
...
inst/ShinyGR/server.R
View file @
38db2aae
...
...
@@ -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
<-
.
s
tartStop
(
data
$
Error
,
FUN
=
is.na
)
dgTSe
<-
.
d
yShadingMulti
(
dygraph
=
dgTSe
,
color
=
rgb
(
0.5
,
0.5
,
0.5
,
alpha
=
0.4
),
idNA
<-
.
S
tartStop
(
data
$
Error
,
FUN
=
is.na
)
dgTSe
<-
.
D
yShadingMulti
(
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
<-
.
s
tartStop
(
getData
()
$
Tab
$
Qobs
,
FUN
=
is.na
)
dgSVq
<-
.
d
yShadingMulti
(
dygraph
=
dgSVq
,
color
=
rgb
(
0.5
,
0.5
,
0.5
,
alpha
=
0.4
),
idNA
<-
.
S
tartStop
(
getData
()
$
Tab
$
Qobs
,
FUN
=
is.na
)
dgSVq
<-
.
D
yShadingMulti
(
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
<-
.
s
tartStop
(
data
$
Qobs
,
FUN
=
is.na
)
dgMDq
<-
.
d
yShadingMulti
(
dygraph
=
dgMDq
,
color
=
rgb
(
0.5
,
0.5
,
0.5
,
alpha
=
0.4
),
idNA
<-
.
S
tartStop
(
data
$
Qobs
,
FUN
=
is.na
)
dgMDq
<-
.
D
yShadingMulti
(
dygraph
=
dgMDq
,
color
=
rgb
(
0.5
,
0.5
,
0.5
,
alpha
=
0.4
),
ts
=
data
$
DatesR
,
idStart
=
idNA
$
start
,
IdStop
=
idNA
$
stop
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment