-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.R
199 lines (160 loc) · 5.3 KB
/
settings.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Copyright 2022-2024 Louis Héraut (louis.heraut@inrae.fr)*1,
# Éric Sauquet (eric.sauquet@inrae.fr)*1,
# Michel Lang (michel.lang@inrae.fr)*1,
# Jean-Philippe Vidal (jean-philippe.vidal@inrae.fr)*1,
# Benjamin Renard (benjamin.renard@inrae.fr)*1
#
# *1 INRAE, France
#
# This file is part of MAKAHO R shiny app.
#
# MAKAHO R shiny app is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# MAKAHO R shiny app is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MAKAHO R shiny app.
# If not, see <https://www.gnu.org/licenses/>.
## 1. PATH AND RESOURCES______________________________________________
# Path to the data
computer_data_path = 'data'
# Resources directory
resources_path = 'resources'
# INRAE logo path
INRAElogo_path = file.path(resources_path,
"logo", "Logo-INRAE_Transparent.png")
# Name of the dictionnary to use for the translation
dico_file = 'dico.txt'
# Creates the dictionnary
dico = ASHE::read_tibble(file.path(resources_path, dico_file), sep=";")
# Icon directory
icon_dir = 'icons'
# Creates icon library
iconLib = create_iconLib(icon_dir, resources_path)
# Filename of the map tiles theme available
theme_file = 'theme.txt'
default_theme = "light"
## 2. MAP PROVIDER ___________________________________________________
# Selection of the provider of map
provider =
'jawg'
# 'stadia'
# Token for the map
jawg_token =
"hEjAgwvvpEJBpIR62stbJUflOVZXM73MoB1hQGAR69fCtoNVQiHJOKp8lVlPOdFH"
## 3. DEFAULT PARAMETERS _____________________________________________
### 3.1. Dataset and variable ________________________________________
default_data = "RRSE"
default_variable = "QA"
if (lg == "fr") {
default_event = "Moyennes Eaux"
} else if (lg == "en") {
default_event = "Mean Flows"
}
licence_file = "ETALAB-Licence-Ouverte-v2.0.pdf"
licence_path = file.path(computer_data_path,
licence_file)
readme_file = "README"
readme_path = file.path(computer_data_path,
readme_file)
readme_tmp_path = file.path(computer_data_path,
"tmp", readme_file)
### 3.2. Info about variable _________________________________________
check_varSub = c("fQ[[:digit:]]+A",
"Q[[:digit:]]+A",
"[_]season",
"[_]month")
SeasonMonth_pattern =
paste0("(",
paste0(c(word("var.month", lg),
word("var.season", lg)),
collapse=")|("),
")")
Months =
c(word("ana.m01", lg), word("ana.m02", lg), word("ana.m03", lg),
word("ana.m04", lg), word("ana.m05", lg), word("ana.m06", lg),
word("ana.m07", lg), word("ana.m08", lg), word("ana.m09", lg),
word("ana.m10", lg), word("ana.m11", lg), word("ana.m12", lg))
### 3.3. Localisation and map ________________________________________
lonFR = 2.213749
latFR = 46.727638
zoomFR = 6
boundsFR = list(north=51.4677, east=17.68799,
south=41.52503, west=-13.24951)
# Min and max zoom of the map
minZoom = 5
maxZoom = 20
### 3.4. Time and date _______________________________________________
# today's date
today = Sys.Date()
# Creates a vector of years
Years = 1900:as.numeric(format(today, "%Y"))
### 3.5. Statistical option __________________________________________
# Level of risk
sigProba = c("1%", "5%", "10%")
sigVal = as.numeric(gsub('%', '' , sigProba))/100
default_alpha = sigVal[3]
### 3.6. Plotting parameters _________________________________________
colorStep = 10
extreme_prob = 0.01
analyseMinYear = 30
# Personnal colors
grey99COL = "#fcfcfc"
grey98COL = "#fafafa"
grey97COL = "#f7f7f7"
grey94COL = "#f0f0f0"
grey90COL = "#e5e5e5"
grey85COL = "#d9d9d9"
grey75COL = "#bfbfbf"
grey70COL = "#b3b3b3"
grey65COL = "#a6a6a6"
grey60COL = "#999999"
grey50COL = "#808080"
grey40COL = "#666666"
grey30COL = "#4d4d4d"
grey20COL = "#333333"
grey18COL = "#2e2e2e"
grey15COL = "#262626"
grey9COL = "#171717"
yellowCOL = "#fddc5c"
orangeCOL = "#ffa62b"
redCOL = "#dc343b"
lightCyanCOL = "#66c1bf"
midCyanCOL = "#008c8e"
darkCyanCOL = "#275662"
INRAECyanCOL = "#00a3a6"
validSColor = grey50COL
validNSColor = grey70COL
invalidColor = yellowCOL
missColor = redCOL
none1Color_light = grey85COL
none2Color_light = grey94COL
none1Color_dark = grey9COL
none2Color_dark = grey18COL
color_to_switch = c(
"#EFD695"="#F6E8C3",
"#A1DCD3"="#C7EAE5",
"#DBBECE"="#EFE2E9",
"#E7BDB8"="#F5E4E2"
)
default_colorbar_choice = "show"
default_resume_choice = "show"
### 3.7. Help option _________________________________________________
N_helpPage = 16
widthHelp = 350
leftHelp = "51%"
topHelp = "45%"
bottomNavHelp = 50
dhNavHelp = 21
### 3.8. CARD parameters _____________________________________________
CARD_path = "CARD"
CARD_dir = "MAKAHOapp"
### 3.9. Dev _________________________________________________________
make_marker = FALSE
nStation_dev = 10