-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
105 lines (89 loc) · 4.09 KB
/
ui.R
File metadata and controls
105 lines (89 loc) · 4.09 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
100
101
102
103
104
105
#################################
#### Google Analytics - ui.R ####
#################################
library(shiny)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
tags$head(
tags$style(HTML("
@import url('//fonts.googleapis.com/css?family=Cookie');
@import url('//fonts.googleapis.com/css?family=Lato:400,400i,700');
h1 {
font-family: Lato;
font-weight: 500;
line-height: 1.1;
color: steelblue;
}
h3 {
font-family: 'Cookie', cursive;
color: #48ca3b;
}
h4 {
font-family: Lato;
color: darkorange;
}
"))
),
h1(HTML("Taylor Polynomial Approximations, <br> centered at 0,
of the cosine function")),
# Simple setup, controls on left, output on right
sidebarLayout(
sidebarPanel(
# submitButton(text="Produce output"),
radioButtons(inputId='graph',
label='Choose the degree of the Taylor Polynomial',
choices=list('Constant function'='0',
'Quadratic polynomial'='2',
'4th degree polynomial'='4',
'6th degree polynomial'='6',
'8th degree polynomial'='8',
'10th degree polynomial'='10',
'12th degree polynomial'='12')),
hr(),
conditionalPanel(
condition = "input.theTabs == 'summary'",
sliderInput(inputId = "sliders",
label = "Find the approximate value of cosine at:",
min = -6, max = 6, value = 0, step = 0.05)
),
conditionalPanel(
condition = "input.theTabs == 'table'"
# sliderInput(inputId = "slider",
# label = "Find the approximate value of cosine at:",
# min = -6, max = 6, value = 0, step = 0.05)
),
conditionalPanel(
condition = "input.theTabs == 'plots'",
sliderInput(inputId = "sliderp",
label = "Find the approximate value of cosine at:",
min = -6, max = 6, value = 0, step = 0.05,
animate = animationOptions(interval = 100, loop=TRUE)),
radioButtons(inputId = "plotPoly",
label = "Plot the polynomial approximation?",
choices = list("Yes" = TRUE, "No" = FALSE), selected=FALSE)
# actionButton("plotPoly", "Update")
),
#
# sliderInput(inputId = "slider",
# label = "Find the approximate value of cosine at:",
# min = -6, max = 6, value = 0, step = 0.05,
# animate = animationOptions(interval = 100, loop=TRUE)),
hr(),
textInput(inputId = "comment",
label = "Comment?",
value = "Shiny rocks!")),
# Show a plot of the generated distribution
mainPanel(
tabsetPanel(id = "theTabs",
tabPanel('Summary',htmlOutput('textDisplay'),
value = "summary"),
tabPanel('Absolute Errors', DT::dataTableOutput('absoluteError'),
value = "table"),
tabPanel('Plots', plotOutput("plotDisplay"),
value = "plots")
),
htmlOutput('someText')
)
)
))