-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
120 lines (93 loc) · 3.92 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
library(shinydashboard)
header <- dashboardHeader(title = "Toggl Dashboard")
sidebar <- dashboardSidebar(
sidebarMenu(
id = "tabs",
menuItem("Time by project",
tabName = "byProject",
icon = icon("tasks")),
menuItem("Time tracking patterns",
menuSubItem("Entries by hour",
tabName = "patternsByHour",
icon = icon("line-chart")),
menuSubItem("Entries by duration",
tabName = "patternsByDuration",
icon = icon("bar-chart")),
startExpanded = TRUE
),
menuItem("Raw data",
tabName = "rawData",
icon = icon("file-text-o")),
menuItem("About",
tabName = "about",
icon = icon("info-circle"))
)
)
body <- dashboardBody(
tabItems(
tabItem(tabName = "byProject",
fluidRow(
tags$head(tags$style(HTML(".small-box {height: 90px}"))),
valueBoxOutput("dateRangeBox", width = 4),
valueBoxOutput("clientsBox", width = 4),
valueBoxOutput("projectsBox", width = 4),
valueBoxOutput("hoursBox", width = 4),
valueBoxOutput("entriesBox", width = 4),
valueBoxOutput("uniqueEntriesBox", width = 4)
),
fluidRow(
box(title = "Time by project",
width = 12,
status = "primary",
solidHeader = TRUE,
plotOutput("plotByProject", height = 290))
)
),
tabItem(tabName = "patternsByHour",
fluidRow(
box(title = "Time tracking patterns: Entries by hour",
width = 9,
status = "primary",
solidHeader = TRUE,
plotOutput("plotPatternsByHour", height = 500)),
box(title = "Explore",
width = 3,
status = "primary",
solidHeader = TRUE,
uiOutput("selectDayType"),
uiOutput("selectStat"),
uiOutput("checkboxSmoother"))
)
),
tabItem(tabName = "patternsByDuration",
fluidRow(
box(title = "Time tracking patterns: Entries by duration",
width = 9,
status = "primary",
solidHeader = TRUE,
plotOutput("plotPatternsByDuration", height = 500)),
box(title = "Explore",
width = 3,
status = "primary",
solidHeader = TRUE,
uiOutput("radioPlotType"),
uiOutput("selectBins"))
)
),
tabItem(tabName = "rawData",
fluidRow(
box(title = "Raw data",
width = 12,
status = "primary",
solidHeader = TRUE,
DT::dataTableOutput("rawDataTable"))
)
),
tabItem(tabName = "about",
fluidRow(
column(width = 12,
shiny::includeHTML("./docs/about.html"))
))
)
)
ui <- dashboardPage(header, sidebar, body)