-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
134 lines (132 loc) · 5.22 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
133
library(tidyverse)
library(shiny)
library(leaflet.extras)
library(geosphere)
library(htmltools)
library(mapview)
library(crosstalk)
library(plotly)
library(shinydashboard)
library(chorddiag)
shinyUI(dashboardPage(
# Headers including Github and Linkedin
dashboardHeader(title = "World War II",
# Linkedin
dropdownMenu(
type = "notifications",
icon = icon("linkedin"),
badgeStatus = NULL,
headerText = "Contact",
notificationItem("Yiqiang Zhao", icon = icon("linkedin-square"),
href = "https://www.linkedin.com/in/yqzhao52/"),
notificationItem("Jay Xu", icon = icon("linkedin-square"),
href = "https://www.linkedin.com/in/zhengjie-xu-b75311a7/")
),
# Github
dropdownMenu(type = "notifications", icon = icon("github"),
badgeStatus = NULL,
headerText = "Github & Data",
notificationItem("Source Code", icon = icon("github-square"),
href = "https://github.com/zhengjxu/dataviz"),
notificationItem("Data", icon = icon("database"),
href = "https://www.kaggle.com/usaf/world-war-ii/data")
)),
# Sidebar
dashboardSidebar(
sidebarMenu(
menuItem(
"Timeline",
tabName = "timeline",
icon = icon("line-chart")
),
menuItem(
"Alliance",
tabName = "alliance",
icon = icon("fighter-jet")),
menuItem(
"Map",
tabName = "maps",
icon = icon("globe")
))
),
# Body
dashboardBody(
tabItems(
# Maps
tabItem(
tabName = "maps",
fluidRow(
tags$style("#instruction {font-size:15px;
font-style:italic; }"),
column(width = 5, htmlOutput("instruction"))),
fluidRow(
box(
width = "100%",
height = "100%",
leafletOutput("mymap", height = 350)
)
),
fluidRow(
box(
width = 6,
plotlyOutput("barplot", height = 300)
),
box(
width = 6,
plotlyOutput("piechart", height = 300)
)
)
),
# Alliances
tabItem(
tabName = "alliance",
fluidRow(
box(title = tags$b("Military Alliance in WW2"), status = "primary",
solidHeader = F, collapsible = F, width = 12,
fluidRow(
tags$style("#allies_axis {font-size:15px;
display:block; }"),
column(width = 9,
htmlOutput("allies_axis")),
column(width = 3, align = "center",
fluidRow(img(src = "allied powers.jpg", height = '170px', width = '250px')),
fluidRow(tags$style("#fig3_text {font-size:12px; font-style:italic;}"),
htmlOutput("fig3_text"), align = "center"))))),
fluidRow(
box(splitLayout(
cellWidths = c("12%", "38%", "50%"),
cellArgs = list(style = "padding: 6px"),
column(width = 1, img(src = "Legend.png", height = '84px', width = '100px'), height = 450),
chorddiagOutput("chorddiag", height = 450),
plotlyOutput("barplot2", height = 450)), width = 12))),
# Timeline
tabItem(
tabName = "timeline",
fluidRow(
box(title = tags$b("Count of Bombing Mission in WW2"), solidHeader = TRUE,
plotlyOutput("timeseries"), width = 12)),
fluidRow(
tabBox(width=12,
tabPanel(tags$b("WW2 Introduction"),
fluidRow(
tags$style("#allies_axis {font-size:15px;
display:block; }"),
column(width = 9, htmlOutput("intro")),
column(width = 3,
fluidRow(align = "center",
img(src = "uss_arizona_burning_sinking-P.jpeg", height = '170px', width = '240px')),
fluidRow(tags$style("#fig1_text {font-size:12px; font-style:italic;}"),
htmlOutput("fig1_text"), align = "center")))),
tabPanel(tags$b("Aircraft Series in WW2"), fluidRow(
tags$style("#allies_axis {font-size:15px;
display:block; }"),
column(width = 9, plotlyOutput("aircraft_series")),
column(width = 3,
fluidRow(div(img(src = "b24b25b17.jpg", height = '190px', width = '270px')), style="text-align: center;"),
fluidRow(tags$style("#fig2_text {font-size:12px; font-style:italic;}"),
htmlOutput("fig2_text"), align = "center"),
fluidRow(tags$style("#fig2_text {font-size:14px;}"),htmlOutput("aircraft_text")))))
)
)
))
)))