This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
113 lines (106 loc) · 5.49 KB
/
index.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
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
from dash.dependencies import Input, Output
from gevent.pywsgi import WSGIServer
from app import app, server
from apps import (BL_Volumes, TL_Volumes, BL_Revenue, TL_Revenue, BL_Trends, BL_Submittal_Type, TL_Submittal_Type,
Permits_Volumes_Revenues, Permits_Trends, Permits_OTC_Review, Permits_Accel_Review,
Imm_Dang, Unsafes, Public_Demos, Uninspected_Service_Requests)
from config import LI_DASHBOARDS_URL
def serve_layout():
return html.Div([
html.Nav([
html.P('City of Philadelphia | LI Stat'),
html.Div([
html.Button('Miscellaneous', className='dropbtn'),
html.Div([
html.A('Imminently Dangerous Violations', href='/imminently-dangerous'),
html.A('Unsafe Violations', href='/unsafes'),
html.A('Public Demolitions', href='/public-demos'),
html.A('Uninspected Service Requests', href='/uninspected-service-requests')
], className='dropdown-content')
], className='dropdown'),
html.Div([
html.Button('Permits', className='dropbtn'),
html.Div([
html.A('Volumes and Revenues', href='/permit-volumes-and-revenues'),
html.A('Trends', href='/permit-trends'),
html.A('OTC vs Review', href='/permits-otc-vs-review'),
html.A('Accelerated Reviews', href='/permits-accelerated-review')
], className='dropdown-content')
], className='dropdown'),
html.Div([
html.Button('Trade Licenses', className='dropbtn'),
html.Div([
html.A('Volumes', href='/trade-license-volumes'),
html.A('Revenue', href='/trade-license-revenue'),
html.A('Submittal Type', href='/trade-license-submittal-types')
], className='dropdown-content')
], className='dropdown'),
html.Div([
html.Button('Business Licenses', className='dropbtn'),
html.Div([
html.A('Volumes', href='/business-license-volumes'),
html.A('Revenue', href='/business-license-revenue'),
html.A('Trends', href='/business-license-trends'),
html.A('Submittal Type', href='/business-license-submittal-types')
], className='dropdown-content')
], className='dropdown'),
], className='navbar'),
html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content'),
html.Div(dt.DataTable(rows=[{}]), style={'display': 'none'})
], className='container', style={'margin': 'auto', 'margin-bottom': '45px'}),
html.Nav([
html.Div([
html.A('Contact LI GIS Team',
href='mailto:ligisteam@phila.gov'),
html.A('GitHub',
href='https://github.com/CityOfPhiladelphia/LI_Stat'),
html.A('LI Dashboards',
href=LI_DASHBOARDS_URL),
], style={'width': '500px', 'margin-left': 'auto', 'margin-right': 'auto'})
], className='footer-navbar')
])
app.layout = serve_layout
@app.callback(Output('page-content', 'children'),
[Input('url', 'pathname')])
def display_page(pathname):
if pathname == '/business-license-volumes':
return BL_Volumes.layout()
elif pathname == '/trade-license-volumes':
return TL_Volumes.layout()
elif pathname == '/business-license-revenue':
return BL_Revenue.layout()
elif pathname == '/trade-license-revenue':
return TL_Revenue.layout()
elif pathname == '/business-license-trends':
return BL_Trends.layout()
elif pathname == '/business-license-submittal-types':
return BL_Submittal_Type.layout()
elif pathname == '/trade-license-submittal-types':
return TL_Submittal_Type.layout()
elif pathname == '/permit-volumes-and-revenues':
return Permits_Volumes_Revenues.layout()
elif pathname == '/permit-trends':
return Permits_Trends.layout()
elif pathname == '/permits-otc-vs-review':
return Permits_OTC_Review.layout()
elif pathname == '/permits-accelerated-review':
return Permits_Accel_Review.layout()
elif pathname == '/public-demos':
return Public_Demos.layout()
elif pathname == '/imminently-dangerous':
return Imm_Dang.layout()
elif pathname == '/unsafes':
return Unsafes.layout()
elif pathname == '/uninspected-service-requests':
return Uninspected_Service_Requests.layout()
else:
return BL_Volumes.layout()
if __name__ == '__main__':
http_server = WSGIServer(('0.0.0.0', 5000), server)
print('Server has loaded.')
http_server.serve_forever()