-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
99 lines (90 loc) · 3.95 KB
/
ui.R
File metadata and controls
99 lines (90 loc) · 3.95 KB
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
getTool <- function(inputId) {
tagList(
singleton(tags$head(tags$script(src = "js/navbar.js"))),
tags$html(includeHTML('www/navbar.html'))
)
}
shinyUI(
pageWithSidebar(
# Using a navbar rather than headerPanel to display app title
headerPanel(''),
sidebarPanel(
tags$head(
tags$style(type="text/css", "label.radio { display: inline-block; }", ".radio input[type=\"radio\"] { float: none; }"),
tags$style(type="text/css", "select { max-width: 200px; }"),
tags$style(type="text/css", "textarea { max-width: 185px; }"),
tags$style(type="text/css", ".jslider { max-width: 200px; }"),
tags$style(type='text/css', ".well { padding: 12px; margin-bottom: 5px; max-width: 280px; }"),
tags$style(type='text/css', ".span4 { max-width: 280px; }")
),
includeHTML("www/js/tools.js"),
includeHTML('www/js/lr.js'),
getTool("tool"),
wellPanel(
uiOutput("datasets")
),
# only show data loading and selection options when in dataview
conditionalPanel(condition = "input.tool == 'dataview'",
conditionalPanel(condition = "input.datatabs == 'View'",
wellPanel(
HTML("<label>Load data: (.rda | .csv | .sav | .dta)</label>"),
actionButton("upload", "Choose a file"),
br(), br(),
selectInput(inputId = "packData", label = "Load package data:", choices = packDataSets, selected = '', multiple = FALSE)
)
),
conditionalPanel(condition = "input.datatabs == 'View' && input.datasets != ''",
wellPanel(
uiOutput("columns"),
tags$style(type='text/css', "#columns { height: 200px; padding-bottom: 35px;}"),
textInput("dv_select", "Subset (e.g., mpg > 20 & vs == 1)", ''), actionButton("sub_select", "Go"),
tags$style(type='text/css', "#dv_select { max-width: 135px; }"),
tags$style(type='text/css', "#sub_select { vertical-align: top; width: 45px; }"),
uiOutput("nrRows")
)
),
conditionalPanel(condition = "input.datatabs == 'Visualize'",
uiOutput("ui_visualize")
),
conditionalPanel(condition = "input.datatabs == 'Transform'",
uiOutput("ui_transform")
)
),
conditionalPanel(condition = "input.tool != 'dataview'",
# the appropriate analysis tool is called based on the selected tool
uiOutput("ui_analysis")
)
# HTML("<a class='btn' href='/'>Refresh</a>")
),
mainPanel(
conditionalPanel(condition = "input.datasets != ''",
conditionalPanel(condition = "input.tool == 'dataview'",
tabsetPanel(id = "datatabs",
tabPanel("View",
selectInput("saveAs", "", choices = c('rda','csv','dta'), selected = NULL, multiple = FALSE),
tags$style(type='text/css', "#saveAs { width: 85px;}"),
downloadButton('downloadData', 'Save data'),
tags$style(type='text/css', "#downloadData { vertical-align: top; height: 18.5px; width: 70px;}"),
tableOutput("dataviewer")
),
tabPanel("Transform",
tableOutput("transform_data"), br(),
verbatimTextOutput("transform_summary")
),
tabPanel("Summarize", HTML('<label>Summarize and explore your data using plyr, reshape, etc.<br>In progress. Check back soon.</label>')),
tabPanel("Visualize", plotOutput("visualize", height = "100%")),
tabPanel("About", includeMarkdown("about.md"))
)
),
conditionalPanel(condition = "input.tool != 'dataview'",
tabsetPanel(id = "analysistabs",
tabPanel("Summary", verbatimTextOutput("summary")),
# Use Summarize / Vizualize labels here?
tabPanel("Plots", plotOutput("plots", height = "100%"))
# tabPanel("Log", verbatimTextOutput('logwork'))
)
)
)
)
)
)