-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
83 lines (80 loc) · 2.89 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
# Author: Jeremy Boyd (jeremyboyd@pm.me)
# Description: ui.R for a Shiny app that shows times from Idaho Interscholastic
# Cycling League races.
# Define UI
ui <- fluidPage(
titlePanel("Idaho Interscholastic Cycling League Race Results"),
setBackgroundImage(src = "wp3064754-idaho-wallpapers.jpg"),
# Javascript to get the height of the window
tags$head(tags$script('
var dimension = [0, 0];
$(document).on("shiny:connected", function(e) {
dimension[0] = window.innerWidth;
dimension[1] = window.innerHeight;
Shiny.onInputChange("dimension", dimension);
});
$(window).resize(function(e) {
dimension[0] = window.innerWidth;
dimension[1] = window.innerHeight;
Shiny.onInputChange("dimension", dimension);
});
'))
# tags$head(tags$style("#error{color: gray;
# font-size: 20px
# }"
# ))
,sidebarLayout(
sidebarPanel(
selectizeInput(
"races"
,label = "Races"
,choices = race_list
,multiple = TRUE
,options = list(placeholder = "Select races"
,maxItems = 9)
)
,selectizeInput(
"division"
,label = "Division"
,choices = division_list
,multiple = TRUE
,options = list(
placeholder = "Select a race division"
,maxItems = 1)
)
,uiOutput("foo")
,conditionalPanel(
condition = "input.select_method == 'Name'"
,selectizeInput(
"riders"
,label = "Names"
,choices = NULL
,selected = NULL
,multiple = TRUE
,options = list(placeholder = "Select names"
,maxItems = 10)
))
,conditionalPanel(
condition = "input.select_method == 'Place'"
,selectizeInput(
"places"
,label = "Places"
,choices = place_list
,multiple = TRUE
,options = list(placeholder = "Select places"
,maxItems = 10)
)
)
,actionButton("submit" ,label = "Submit")
,br()
,br()
,textOutput("error")
)
,mainPanel(
plotlyOutput(
"figure"
,width = "100%"
)
)
)
)