-
Notifications
You must be signed in to change notification settings - Fork 5
/
ui_bac.R
143 lines (129 loc) · 4.49 KB
/
ui_bac.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
# TODO: Add comment
# Jul 28, 2014
# Author: Kirk Li
# Email: [email protected]
###############################################################################
# TODO: Add comment
#
# Author: kirk
###############################################################################
library(shiny)
library(shinyData)
source("chooser.R")
source("functions.R")
# write uiOutput for Modifying parameter value.
UI_G1 <- function(group=NULL){
tmp <- lapply(1:12,function(ct) {eval(parse(text=paste("uiOutput('para_",group,".",ct,"')",sep="",collapse="")))})
tmp
}
# function to generate dynamic ui for Type2
#UI_G2 <- function(){
# tmp <- lapply(1:12,function(ct) {eval(parse(text=paste("uiOutput('paraT2.",ct,"')",sep="",collapse="")))})
# tmp
#}
customTextInput<-function (inputId, label, value="",...) {
tagList(tags$label(label, `for` = inputId), tags$input(id = inputId,
type="text",
value=value,...))
}
shinyUI(navbarPage("Dynamic Network Visualization",
tabPanel("ndtv app",
tabsetPanel(
tabPanel('Data',
fluidRow(
splitLayout(
wellPanel(
h3('Choose a dataset'),
selectInput('dataset',
label = 'Sample datasets',
c(Choose = '', 'stergm.sim.2'),
selectize = FALSE),
br(),
actionButton('load_ndtv', 'Load Data')
),
wellPanel(
h3("Summary of Network Dynamic"),
verbatimTextOutput("nwdndtv")
)
))),
tabPanel('Computation Parameter',
fluidRow(
splitLayout(
wellPanel(
chooserInput("mychooser_slice.par", "Available arguments", "Selected
metrics",slice.par.arg.vec(), c(), size = 10, multiple = TRUE
),
h3("Parameter Value"),
column(4,
UI_G1("slice.par")),
column(1),
column(4,
verbatimTextOutput("exp_slice.par"))#
),
wellPanel(
chooserInput("mychooser_ca", "Available arguments", "Selected
metrics",ca.arg.vec(), c(), size = 10, multiple = TRUE
),
h3("Parameter Value"),
column(4,
UI_G1("ca")),
column(1),
column(4,
verbatimTextOutput("exp_ca"))#
)
),
br(),
actionButton('compute_ndtv', 'Compute'),
verbatimTextOutput('console_ca_ndtv'))),
tabPanel('Rendering Argument',
fluidRow(
splitLayout(
wellPanel(
chooserInput("mychooser_render.par", "Available arguments", "Selected
metrics",render.par.arg.vec(), c(), size = 10, multiple = TRUE
),
h3("Parameter Value"),
column(4,
UI_G1("render.par")),
column(1),
column(4,
verbatimTextOutput("exp_render.par"))#
),
wellPanel(
chooserInput("mychooser_ra", "Available arguments", "Selected
metrics",ra.arg.vec(), c(), size = 10, multiple = TRUE
),
h3("Parameter Value"),
column(4,
UI_G1("ra")),
column(1),
column(4,
verbatimTextOutput("exp_ra"))#
)),
br(),
actionButton('render_ndtv', 'Render'),
verbatimTextOutput('console_ra_ndtv'))),
tabPanel('Play Moive',
fluidRow(
splitLayout(
wellPanel(
br(),
actionButton('save_ndtv', 'Play'),
verbatimTextOutput('console_ra_ndtv'),
tags$head(tags$script(src="moivebutton.js")),
uiOutput("movie1")
), wellPanel(
chooserInput("mychooser_sa", "Available arguments", "Selected
metrics",sa.arg.vec(), c(), size = 10, multiple = TRUE
),
h3("Parameter Value"),
column(4,
UI_G1("sa")),
column(1),
column(4,
verbatimTextOutput("exp_sa")),
downloadLink('downloadData', 'Download')
)
))
))
)))