-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavbar.py
174 lines (158 loc) · 4.61 KB
/
navbar.py
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import dash_bootstrap_components as dbc
import dash_html_components as html
FA = "https://use.fontawesome.com/releases/v5.8.1/css/all.css"
SIDEBAR_STYLE = {
"position": "fixed",
"top": 0,
"left": 0,
"bottom": 0,
"width": "18rem",
"padding": "2rem 1rem",
"background-color": "#4c4c57",
"color": "#f4f5f7",
"font-family" : "Arial"
}
submenu_1 = [
html.Li(
# use Row and Col components to position the chevrons
dbc.Row( #Screen is split in rows and columns. This is the first row with 2 columns
[
dbc.Col(html.I(className="fab fa-twitter"),width="2"),
dbc.Col("Twitter",width="6"),
dbc.Col(
html.I(className="fas fa-chevron-down mr-2") #-down was -right. mr-X, X is the position
),
],
no_gutters=True,
className="my-1",
),
id="submenu-1",
),
dbc.Collapse(
[
dbc.NavLink("Sentiment Analysis", href="/apps/t_sentiment"),
dbc.NavLink("Word Cloud", href="/apps/t_cloud"),
],
id="submenu-1-collapse",
),
]
submenu_2 = [
html.Li(
dbc.Row(
[
dbc.Col(html.I(className="fas fa-car-crash"),width="2"),
dbc.Col("Accidents",width="6"),
dbc.Col(
html.I(className="fas fa-chevron-down mr-2"),
),
],
no_gutters=True,
className="my-1",
),
id="submenu-2",
),
dbc.Collapse(
[
dbc.NavLink("Borough Report", href="/apps/a_borough"),
dbc.NavLink("Accident Locations", href="/apps/a_accidentmap"),
dbc.NavLink("Accident Factors", href="/apps/a_accidentfactors")
],
id="submenu-2-collapse",
),
]
submenu_3 = [
html.Li(
# use Row and Col components to position the chevrons
dbc.Row( #Screen is split in rows and columns. This is the first row with 2 columns
[
dbc.Col(html.I(className="fas fa-subway"),width="2"),
dbc.Col("Tube",width="6"),
dbc.Col(
html.I(className="fas fa-chevron-down mr-2") #-down was -right. mr-X, X is the position
),
],
no_gutters=True,
className="my-1",
),
id="submenu-3",
),
dbc.Collapse(
[
dbc.NavLink("Borough Distribution", href="/apps/a_boroughload"),
dbc.NavLink("Station Congestion", href="/apps/a_stationusage"),
],
id="submenu-3-collapse",
),
]
submenu_4 = [
html.Li(
dbc.Row(
[
dbc.Col(html.I(className="far fa-chart-bar"),width="2"),
dbc.Col("Facilities",width="6"),
dbc.Col(
html.I(className="fas fa-chevron-down mr-2"),
),
],
no_gutters=True,
className="my-1",
),
id="submenu-4",
),
dbc.Collapse(
[
dbc.NavLink("Cycle Usage", href="/apps/a_cycleusage"),
dbc.NavLink("Parking", href="/apps/a_park"),
],
id="submenu-4-collapse",
),
]
submenu_5 = [
html.Li(
dbc.Row(
[
dbc.Col(html.I(className="fas fa-bus-alt"),width="2"),
dbc.Col("Bus",width="6"),
dbc.Col(
html.I(className="fas fa-chevron-down mr-2"),
),
],
no_gutters=True,
className="my-1",
),
id="submenu-5",
),
dbc.Collapse(
[
dbc.NavLink("Performance", href="/apps/perf"),
],
id="submenu-5-collapse",
),
]
def Navbar():
navbar = html.Div(
[
html.A(
[
html.Img(src='/assets/n9hyiWD.png',
style={
'height': '20%',
'width': '100%',
'border-radius': '50%',
'position': 'relative',
'padding-top': 0,
'padding-right': 0
}
),
],href='/home'
),
html.Hr(),
html.P(
"", className="lead"
),
dbc.Nav(submenu_2 + submenu_3 + submenu_5 + submenu_4 + submenu_1, vertical=True),
],
style=SIDEBAR_STYLE,
id="sidebar",
)
return navbar