-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
82 lines (75 loc) · 2.39 KB
/
utils.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
import dash_html_components as html
import dash_core_components as dcc
def Header(app):
return html.Div([get_header(app), html.Br([]), get_menu()])
def get_header(app):
header = html.Div(
[
html.Div(
[
html.Img(src=app.get_asset_url("virus.jpg"),className="logo"),
# html.A(
# html.Button("Learn More", id="learn-more-button"),
# href="https://plot.ly/dash/pricing/",
# ),
],
className="row",
),
html.Div(
[
html.Div(
[html.H5("Dashboard COVID-19")],
className="main-title",
),
],
className="twelve columns",
style={"padding-left": "0"},
),
],
className="row",
)
return header
def get_menu():
menu = html.Div(
[
dcc.Link(
"Panorama general",
href="/dash-covid/overview",
className="tab first",
),
dcc.Link(
"Historico de casos",
href="/dash-covid/historical",
className="tab",
),
dcc.Link(
"Distribución de casos",
href="/dash-covid/distribution",
className="tab",
),
# dcc.Link(
# "Fees & Minimums", href="/dash-financial-report/fees", className="tab"
# ),
# dcc.Link(
# "Distributions",
# href="/dash-financial-report/distributions",
# className="tab",
# ),
# dcc.Link(
# "News & Reviews",
# href="/dash-financial-report/news-and-reviews",
# className="tab",
# ),
],
className="row all-tabs",
)
return menu
def make_dash_table(df):
""" Return a dash definition of an HTML table for a Pandas dataframe """
table = []
for index, row in df.iterrows():
html_row = []
for i in range(len(row)):
html_row.append(html.Td([row[i]]))
table.append(html.Tr(html_row))
return table