-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
83 lines (55 loc) · 1.61 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
library(shinythemes)
library(shiny)
library(DT)
library(bcp)
shinyUI(navbarPage("Bayesian Change Point", id="nav", theme = shinytheme("paper"),
tabPanel("Trump Approval",
div(class="outer",
sidebarLayout(
sidebarPanel(
tags$style(type="text/css",
".shiny-output-error { visibility: hidden; }",
".shiny-output-error:before { visibility: hidden; }"
),
actionButton("trumpbayes", label = "Go"),
downloadButton('downloadtrumpplot', label="Plot"),
downloadButton('downloadtrumptable', label="Table"),
tags$p("Click 'Go' to start analysis"),
tags$hr(),
sliderInput("prior", label="Prior Probability of a change-point", min=0.001, max=1, value=0.001),
tags$p("A smaller prior is better for big data sets"),
tags$hr(),
uiOutput('selectPeople'),
uiOutput('selectPollster'),
uiOutput('selectMode'),
uiOutput('selectPartisan'),
tags$p("Choose your inputs, but keep in mind live telephone interviews are more reliable")
),
mainPanel(
tabsetPanel(
id = 'dataset',
tabPanel('Plot',
# this is an extra div used ONLY to create positioned ancestor for tooltip
# we don't change its position
div(
style = "position:relative",
plotOutput("approvalOutput", height = 400,
hover = hoverOpts("plot_hoverapproval", delay = 100, delayType = "debounce")),
uiOutput("hover_infoapproval")
),
div(
style = "position:relative",
plotOutput("posteriorProbOutput", height = 200,
hover = hoverOpts("plot_hoverposteriorprob", delay = 100, delayType = "debounce")),
uiOutput("hover_infoposteriorprob")
)
),
tabPanel("Bayes Table", DT::dataTableOutput('trumpchangepointtable')),
tabPanel("Poll Table", DT::dataTableOutput('trumppolltable'))
)
)
)
)
)
)
)