-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
132 lines (128 loc) · 3.88 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
library(shiny)
library(shinydashboard)
library(dygraphs)
library(xts)
library(googlesheets)
library(dplyr)
library(tidyr)
library(lubridate)
library(ggplot2)
library(leaflet)
library(shinydashboardPlus)
library(zoo)
library(geosphere)
source("./watchpos.R")
source("data/golf_data.R")
shinyUI(
dashboardPage(
dashboardHeader(title = "Personal Golf Statistics"),
dashboardSidebar(sidebarMenu(
menuItem(
"Historic Data",
tabName = "historicData",
icon = icon("dashboard")
),
menuItem(
"Course Statistics",
tabName = "courseStatistics",
icon = icon("th")
),
menuItem(
"Distance to Hole",
tabName = "distanceToHole",
icon = icon("th")
)
)),
dashboardBody(tabItems(
# Historic Data Tab -----------------------------------------------------
tabItem(
tabName = "historicData",
fluidRow(
valueBoxOutput("totalGames", width = 2),
valueBoxOutput("totalHoles", width = 2),
valueBoxOutput("totalShots", width = 2),
valueBoxOutput("avgShots9Holes", width = 2),
valueBoxOutput("avgShots18Holes", width = 2),
valueBoxOutput("daysSince", width = 2)
),
fluidRow(
box(dygraphOutput("historicScores9Holes"), width = 4),
box(dygraphOutput("historicScores18Holes"), width = 4),
box(
tableOutput("historicTable"),
title = "Last 10 Games",
width = 4
)
),
fluidRow(
box(
title="2018 Goals", width = 4,
"My goal for 2018 is to play 4 matches on a row without any 10 on the card."
),
infoBoxOutput("goalFulfilled", width = 2),
infoBoxOutput("last4GamesAverageShots", width = 2)
),
fluidRow(
box(dygraphOutput("parsPerGame"), width = 4)
)
),
# Course Statistics Tab -----------------------------------------------------
tabItem(
tabName = "courseStatistics",
fluidRow(box(
selectInput("courseInput", "Select Course:", courses$course, selected = "ALL"),
width = 2
),
box(leafletOutput("courseMap"),title = "Course Map", width = 5),
gradientBox(
title = "Course Historic Games",
boxToolSize = "sm",
width = 5,
collapsible = FALSE,
footer = column(
width = 12,
align = "center",
radioButtons(
"holesCourseInput",
"Holes Played:",
choices = unique(cards$holes_round)
)
),
dygraphOutput("historicScoresCourseStatistics")
)
),
fluidRow(
valueBoxOutput("courseTotalGames", width = 2),
valueBoxOutput("courseTotalHoles", width = 2),
valueBoxOutput("courseTotalShots", width = 2),
valueBoxOutput("courseAvgShots9Holes", width = 2),
valueBoxOutput("courseAvgShots18Holes", width = 2),
valueBoxOutput("courseDaysSince", width = 2)
),
fluidRow(
box(radioButtons("holeInput", choices = unique(courses$hole), label = "Select Course Hole: ", inline = TRUE),width = 12)
),
fluidRow(
box(dygraphOutput("holeStrokesHistory"), width = 6)
),
fluidRow(box(
plotOutput("historicDispersion"), width = 12
))
),
# Distance to Hole -----------------------------------------------------
tabItem(
tabName = "distanceToHole",
fluidRow(
column(2,
fluidRow(watchpos,
box(selectInput("courseInputDistance", "Select Course:", courses$course, selected = "ALL"), width = 12)),
fluidRow(box(radioButtons("holeInputDistance", choices = unique(courses$hole), label = "Select Course Hole: "), width = 12))
),
column(10,
fluidRow(box(textOutput("distance"), width = 12)),
fluidRow(box(leafletOutput("courseMapDistance"), title = "Course Map", width = 12)))
)
)
))
)
)