-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
117 lines (113 loc) · 5.34 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
####################################
##
## User Interface for
## KS:Stature
##
####################################
# Libraries
library(shiny)
library(shinyBS)
library(shinydashboard)
library(shinyjs)
library(shinyMatrix)
library(markdown)
# Imports
source("R/short_blurb.R")
# Matrix for measurement input
meas_mat <- matrix(NA,4,6)
rownames(meas_mat) <- c("Length","Proximal","Midshaft","Distal")
colnames(meas_mat) <- c("Femur","Tibia","Fibula","Humerus","Radius","Ulna")
# Start of UI
fluidPage(theme="make-me-pretty.css",
useShinyjs(),
h1(id="big-heading", "KidStats: Stature"),
sidebarLayout(
sidebarPanel(id="sidebar",
h4(tags$b("Case Information:")),
textInput("analyst",label=h6(tags$b("Analyst (Required)")),
placeholder="XXXX"),
textInput("caseid",label=h6(tags$b("Case ID (Required)")),
placeholder="XXXX"),
h4(tags$b("Reference Demographics:")),
radioButtons("sex",label=h6(tags$b("Sex:")),
choices=list(
"Pooled"="pooled",
"Male"="M",
"Female"="F"
), selected="pooled"),
selectInput("dem",label=h6(tags$b("Geographic Region:")),
choices=list(
"United States"="US"
), selected="US"),
actionButton("reset_side","Reset Info",icon("trash")),
hr(),
tags$b("Citation: "),"Chu EY & Stull KE. (2023). KidStats: Stature - A graphical
user interface for subadult stature estimation. Version ",gui_version(),
br(), br(),
tags$b("Contact: "),"Elaine Y. Chu, Ph.D (",a(href="[email protected]","[email protected]"),")",
br(), br(),
tags$b("Last Updated: February 2023")
), # close sidebarPanel
mainPanel(
blurb,
hr(),
bsCollapse(id="main",multiple=T,open="Measurements",
bsCollapsePanel(title="Measurements",
matrixInput("mmat",
value=meas_mat,
cols=list(names=T),
rows=list(names=T),
class="numeric"),
div(column(4,offset=1,
actionButton("reset_main","Reset Measurements",icon("trash"))),
column(3),
column(4, disabled(actionButton("run","Run Analysis",
icon("arrow-right"))))),
div(column(12, align="center",
shinyjs::hidden(br(),h3("Generating results, please wait...", id="wait"))))
),
bsCollapsePanel(title="Output",
# tableOutput("mdf") # FOR DEBUG
fluidRow(
column(7,
wellPanel(
h4("Case Info"),
textOutput("report_analyst"),
textOutput("report_case"),
textOutput("report_date"),
textOutput("report_version"),
tableOutput("ref_specs"),
id="caseinfo"
)
),
column(2,
downloadButton("dwn_report",
"Download Report",
style="background-color:#FFFFFFF")
)
),
hr(),
tableOutput("pred_tbl"),
hr(),
# plot with prediction against reference data
fluidRow(
column(3,
selectInput("pick_var",
"Select Variable to Plot:",
choices="None"),
selectInput("pick_type",
"Select Model Type to Plot:",
choices=list(
"Nonlinear"="nonlinear",
"Linear"="linear"
),selected="nonlinear")
),
column(9,
plotOutput("pred_plot")
)
) # close fluidRow
) # close bsCollapsePanel-output
) # close bsCollapse
) # close mainPanel
) # close sidebarLayout
) # close fluidPage