forked from sybila/pithya-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
324 lines (306 loc) · 15.7 KB
/
ui.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
if(!require(shiny,quietly = T)) {install.packages("shiny", dependencies=T,quiet = T); library(shiny,quietly = T)}
if(!require(shinyBS,quietly = T)) {install.packages("shinyBS", dependencies=T,quiet = T); library(shinyBS,quietly = T)}
if(!require(shinyAce,quietly = T)) {install.packages("shinyAce", dependencies=T,quiet = T); library(shinyAce,quietly = T)}
if(!require(shinyjs,quietly = T)) {install.packages("shinyjs", dependencies=T,quiet = T); library(shinyjs,quietly = T)}
require(parallel) # it is needed because of function for determination of available CPU cores
#if(!require(shinythemes,quietly=T)) install.packages("shinythemes",quiet=T); library(shinythemes,quietly=T)
#require(shiny)
source("tooltips.R")
## LOOK AT SHINY.OPTIONS
# customSlider javascript function for output threshold instead of index
JS.custom <-
"
// function to get custom values into a sliderInput
function customSlider (sliderId,values) {
$('#'+sliderId).data('ionRangeSlider').update({
'prettify': function (num) { return (values[num]); }
});
}"
# general handler function for scale sliders calling function customSlider
JS.scaleSliderHandler <- "
Shiny.addCustomMessageHandler('scaleSliderHandler',
function(data) {
//var name = data['name'];
//var values = data['values'];
customSlider(data['name'],data['values']);
}
);
"
# message handler for giving an information about finished prameter synthesis
JS.parameterSynthesisFinished <- "
Shiny.addCustomMessageHandler('paramSynthEnd', function(message) {
eval(message.value);
});
"
# message handler for giving an information about missing threshold
JS.missingThreshold <- "
Shiny.addCustomMessageHandler('missThres', function(message) {
Shiny.onInputChange('missing_threshold_counter',Math.random());
Shiny.onInputChange('missing_threshold',eval(message.value));
Shiny.onInputChange('missing_threshold_data',eval(message.data));
})
"
source("global.R")
shinyUI(
fluidPage(
useShinyjs(),
tags$head(tags$script(HTML(JS.parameterSynthesisFinished))),
tags$head(tags$script(HTML(JS.missingThreshold))),
titlePanel(Tool_name),
tags$hr(),
tabsetPanel(id = "dimensions",
tabPanel(Editor_label, icon=icon("bug"), # fa-leaf fa-bug
tags$div(title=Editor_tooltip,
fluidPage(
column(6,
wellPanel(
fluidPage(
column(4,
tags$div(title=Editor_advancedSettings_tooltip,
checkboxInput("advanced", Editor_advancedSettings_label, F)),
tags$div(title=Editor_model_Browse_tooltip,
fileInput("vf_file", Editor_model_Browse_label, accept=".bio"))
# ,tags$div(title="Select input state space (with '.ss.json' extension) for further analysis.",
# fileInput("state_space_file","choose '.abst.bio' file",accept=".bio"))
),
column(4,
verticalLayout(
# tags$div(title="This button accepts all changes made in model editor so they could be passed on to further analysis.",
# actionButton("accept_model_changes","check syntax of model",icon=icon("ok",lib = "glyphicon"))),
tags$div(title=Editor_model_resetChangesInModel_tooltip,
actionButton("reset_model", Editor_model_resetChangesInModel_label, icon=icon("remove",lib = "glyphicon"))),
tags$div(title=Editor_model_saveModel_tooltip,
downloadButton("save_model_file", Editor_model_saveModel_label)
# ,textInput("save_model_file_name", NULL, "model.bio", "100%", "model.bio")
)
)
),
column(4,
# wellPanel(
conditionalPanel(
condition = "input.advanced == true",
tags$div(title=Editor_cutTresholds_tooltip,
checkboxInput("thresholds_cut", Editor_cutTresholds_label,F)),
tags$div(title=Editor_fastApproximation_tooltip,
checkboxInput("fast_approximation", Editor_fastApproximation_label,F))
),
tags$div(title=Editor_generateApproximation_tooltip,
bsButton("generate_abstraction", Editor_generateApproximation_label, disabled=T))
# )
)
)
)
),
# tags$script(tags$html("<hr width='2' size='500' color='red'>")),
column(4,
wellPanel(
fluidPage(
column(6,
tags$div(title=Editor_property_Browse_tooltip,
fileInput("prop_file", Editor_property_Browse_label, accept=".ctl"))
),
column(6,
# tags$div(title="This button accepts all changes made in editor so they could be passed on to further analysis.",
# actionButton("accept_prop_changes","check syntax of properties",icon=icon("ok",lib = "glyphicon"))),
tags$div(title=Editor_property_resetChangesInProperties_tooltip,
actionButton("reset_prop", Editor_property_resetChangesInProperties_label, icon=icon("remove",lib = "glyphicon"))),
tags$div(title=Editor_property_saveProperties_tooltip,
downloadButton("save_prop_file", Editor_property_saveProperties_label))
)
)
)
),
column(2,
wellPanel(
conditionalPanel(
condition = "input.advanced == true",
tags$div(title=Editor_numberOfThreads_tooltip,
numericInput("threads_number", Editor_numberOfThreads_label, 1,#detectCores(),
1, detectCores(), 1))
),
tags$div(title=Editor_runParameterSynthesis_tooltip,
bsButton("process_run", Editor_runParameterSynthesis_label, disabled=T)),
tags$div(title=Editor_stopParameterSynthesis_tooltip,
bsButton("process_stop", Editor_stopParameterSynthesis_label, disabled=T))
)
)
),
# bsModal("missing_threshold","neco","",size="small",wellPanel(
# actionButton("yes_button", "Ok"),
# actionButton("no_button", "Cancel"))
# ),
tags$div(title=Editor_progressBar_tooltip,
helpText(Editor_progressBar_label),
verbatimTextOutput("progress_output")),
fluidPage(
column(6,
tags$div(title=Editor_modelTextEditor_tooltip,
helpText(Editor_modelTextEditor_label),
aceEditor("model_input_area","","plain_text","textmate",debounce=100))
),
column(6,
tags$div(title=Editor_propertyTextEditor_tooltip,
helpText(Editor_propertyTextEditor_label),
aceEditor("prop_input_area","","plain_text","textmate",debounce=100))
)
))
),
# tabPanel("property editor",icon=icon("gears"), # fa-eye fa-bolt fa-gears fa-key fa-heartbeat fa-fire fa-history fa-stethoscope
# tags$div(title="'Property editor' allows the user load, edit or save properties of interest. One property is automatically loaded as example.",
# fluidPage(
# #theme = shinytheme("united"),
# column(3,
# tags$div(title="Select input model (with '.bio' extension) for further analysis.",
# fileInput("prop_file","choose '.ctl' file",accept=".ctl"))
# ),
# column(3
# ),
# column(6,
# tags$div(title="This button accepts all changes made in editor so they could be passed on to further analysis.",
# actionButton("accept_prop_changes","accept changes",icon=icon("ok",lib = "glyphicon"))),
# tags$div(title="This button resets all changes made up to last load or save of current file.",
# actionButton("reset_prop","reset changes",icon=icon("remove",lib = "glyphicon"))),
# tags$div(title="This button saves current state of properties description.",
# downloadButton("save_prop_file","save"))
#
# )
# ),
# tags$textarea(id="prop_input_area", rows=200, cols=300))
# ),
# tabPanel("process settings",icon=icon("wrench",lib = "glyphicon"), # fa-sliders fa-wrench
# fluidPage(
# column(2,
# numericInput("threads_number","no. of threads",1,1,8,1)
# ),
# column(2
# ),
# column(2,
# actionButton("process_run","Run model checking")
# #,checkboxGroupInput("what_to_run","",c("model_checking"="mc", "states_generator"="sg"),c("mc","sg"))
# )
# ),
# helpText("Progress bar:"),
# verbatimTextOutput("progress_output")
# ),
tabPanel(Explorer_label, icon=icon("move",lib = "glyphicon"),
tags$div(title=Explorer_tooltip,
fluidPage(
theme = "simplex.css",
fluidRow(
column(2,
uiOutput("model_help_text"),
fluidRow(
column(4,
tags$div(title=Explorer_previousExperiment_tooltip,
bsButton("model_prev",Explorer_previousExperiment_label,disabled=T,block=T)
)),
column(4,
tags$div(title=Explorer_nextExperiment_tooltip,
bsButton("model_next",Explorer_nextExperiment_label,disabled=T,block=T)
)),
column(4,
tags$div(title=Explorer_deleteExperiment_tooltip,
bsButton("model_del",Explorer_deleteExperiment_label,disabled=T,block=T)
))
),
tags$div(title=Explorer_saveExperimentModel_tooltip,
downloadButton("save_current_model_file",Explorer_saveExperimentModel_label))
),
column(4,
fluidRow(
column(6,
tags$div(title=Explorer_countOfDirectionArrows_tooltip,
sliderInput("arrows_number",Explorer_countOfDirectionArrows_label,10,100,step=1,value=25)),
tags$div(title=Explorer_coloringThreshold_tooltip,
sliderInput("colThr",Explorer_coloringThreshold_label,0,0.1,step=0.001,value=0.05))
),
column(6,
tags$div(title=Explorer_lengthOfDirectionArrows_tooltip,
sliderInput("arrowSize",Explorer_lengthOfDirectionArrows_label,0.01,2,step=0.05,value=0.3)),
tags$div(title=Explorer_widthOfAllArrows_tooltip,
sliderInput("transWidth",Explorer_widthOfAllArrows_label,1,5,step=0.5,value=1.5))
)
),
tags$div(title=Explorer_coloringDirection_tooltip,
radioButtons("colVariant",Explorer_coloringDirection_label,list(both="both",none="none",horizontal="horizontal",vertical="vertical"),"both",inline=T))
),
column(2,
uiOutput("param_sliders_bio")
),
column(2
# ,uiOutput("param_sliders")
),
# column(2,
# sliderInput("height","height of plots",min=200,max=800,value=650,step=20),
# uiOutput("zoom_sliders"),
# actionButton("execute_zoom","zoom")
# ),
column(4,
uiOutput("selector"),
tags$div(title=Explorer_addPlot_tooltip,
bsButton("add_vf_plot",Explorer_addPlot_label,icon=icon("picture",lib="glyphicon"), disabled=T))
)
),
tags$hr(),
uiOutput("plots")
))
),
tabPanel(Result_label, icon=icon("barcode",lib = "glyphicon"),
tags$div(title=Result_tooltip,
fluidPage(
theme = "simplex.css",
fluidRow(
column(2,
uiOutput("result_help_text"),
fluidRow(
column(4,
tags$div(title=Result_previousExperiment_tooltip,
bsButton("result_prev",Result_previousExperiment_label,disabled=T,block=T)
)),
column(4,
tags$div(title=Result_nextExperiment_tooltip,
bsButton("result_next",Result_nextExperiment_label,disabled=T,block=T)
)),
column(4,
tags$div(title=Result_deleteExperiment_tooltip,
bsButton("result_del",Result_deleteExperiment_label,disabled=T,block=T)
))
),
tags$div(title=Result_Browse_tooltip,
fileInput("ps_file", Result_Browse_label,accept=".json")),
fluidRow(
column(6,
tags$div(title=Result_BrowseReload_tooltip,
bsButton("reload_result_file", Result_BrowseReload_label, disabled=T))),
column(6,
tags$div(title=Result_saveResults_tooltip,
downloadButton("save_result_file",Result_saveResults_label)))
)
),
column(2,
tags$div(title=Result_showParametersCoverage_tooltip,
checkboxInput("coverage_check", Result_showParametersCoverage_label, F)),
conditionalPanel(
condition = "input.coverage_check == true",
tags$div(title=Result_greyShadeDegree_tooltip,
sliderInput("color_alpha_coeficient", Result_greyShadeDegree_label,min=0,max=1,value=0.9,step=0.01,ticks=F)),
tags$div(title=Result_parameterDensity_tooltip,
sliderInput("density_coeficient",Result_parameterDensity_label,min=10,max=150,value=50,step=1,ticks=F))
),
uiOutput("ps_zoom_sliders")
),
column(4,
uiOutput("chosen_ps_states_ui")
),
column(4,
uiOutput("param_selector"),
tags$div(title=Result_addPlot_tooltip,
bsButton("add_param_plot",Result_addPlot_label,icon=icon("picture",lib="glyphicon"), disabled=T))
)
),
tags$hr(),
uiOutput("param_space_plots")
))
)
)
))