-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
95 lines (75 loc) · 3.12 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
library(shiny)
shinyUI(fluidPage(
# Application title
titlePanel("US Stocks"),
fluidRow(
column(2,
wellPanel(
fileInput(
'stocklistfile', 'Upload stock list',
accept = c(
'text/csv',
'text/comma-separated-values',
'text/tab-separated-values',
'text/plain',
'.csv'
)
)
),
conditionalPanel(
condition = "output.fileUploaded",
wellPanel(
radioButtons("numPlot",label = "Plot",
choices = c("Single","Comparison"),
selected = "Single"
)
)
),
conditionalPanel(
condition = "output.fileUploaded",
wellPanel(
selectInput("myStock1", label = "Stock list 1",
choices = NULL),
fluidRow(
column(1,actionButton("prev1", label = "Previous")),
column(1,actionButton("nxt1", label = "Next"),offset=4)
)
)
),
conditionalPanel(
condition = "output.fileUploaded & input.numPlot=='Comparison'",
wellPanel(
selectInput("myStock2", label = "Stock list 2",
choices = NULL),
fluidRow(
column(1,actionButton("prev2", label = "Previous")),
column(1,actionButton("nxt2", label = "Next"),offset=4)
)
)
)
),
# TA control
conditionalPanel(
condition = "output.fileUploaded",
column(2,
wellPanel(
radioButtons("period",label = "Selected period",
choices = PERIOD[[1]],
selected = 'last 3 months'),
checkboxGroupInput("tas", label = "TAs",choices = TAS[[1]],
selected = TAS[[1]])
)
)
),
# Show a plot of stock
conditionalPanel(
condition = "output.fileUploaded",
column(8,tabsetPanel(
tabPanel("Stock 1", plotOutput("chart1",height = "600")),
tabPanel("Stock 2", conditionalPanel(condition = "input.numPlot=='Comparison'",
plotOutput("chart2",height = "600")))
)
)
)
)
))