-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
72 lines (54 loc) · 2.31 KB
/
app.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
# Global health and sanitation Analysis Dashboard
# Author: Zhiji Ding
# built-in modules
import os
import flask
import dash_core_components as dcc
import dash_html_components as html
from datetime import datetime
# server
from server import app, server
# dash layouts
from layouts import first_tab, second_tab, third_tab
#############################
# Dash Layout
#############################
app.title = "Global health and sanitation Analysis"
@server.route('/favicon.ico')
def favicon():
return flask.send_from_directory(os.path.join(server.root_path, 'static'), 'favicon.ico')
app.layout = html.Div([
html.Img(src = 'assets/E_SDG_logo_No UN Emblem_horizontal_rgb.png', height = '60vh', width = '280vw', style = {'display': 'inline-block', 'padding-bottom': 8}),
dcc.Tabs(id = 'tabs',
children = [first_tab.get_tab_layout(),
second_tab.get_tab_layout(),
third_tab.get_tab_layout(),
],
style = {'height': '6vh', 'borderBottom': '1px solid #d6d6d6', 'fontWeight': 'bold'}),
html.Hr(),
html.Div([f"Copyright © {datetime.now().year}. Created by ",
html.A("Zhiji Ding", href = "https://www.linkedin.com/in/zhiji-ding-97824610/", target = '_blank')],
style = {'font-size': '9pt'})
])
#############################################################
# Importing call-back functions
#############################################################
app.config['suppress_callback_exceptions']=True
from callbacks.first_tab import health_expenditure
from callbacks.first_tab import health_risk
from callbacks.first_tab import life_expectancy_map
from callbacks.first_tab import show_country
from callbacks.second_tab import basic_sanitation
from callbacks.second_tab import life_GNI_scatter
from callbacks.second_tab import well_managed_sanitation
from callbacks.third_tab import basic_drinking_water
from callbacks.third_tab import hand_washing
from callbacks.third_tab import open_defecation
from callbacks.third_tab import well_managed_drinking_water
#############################
# Launching the server
#############################
if __name__ == '__main__':
app.run_server(debug=True)
#############################################################
#############################################################