-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (37 loc) · 1.21 KB
/
main.py
File metadata and controls
43 lines (37 loc) · 1.21 KB
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
import dash
import dash_bootstrap_components as dbc
from dash.dependencies import Output, Input
import dash_core_components as dcc
import dash_html_components as html
from mlvc.pages.company_page import render as render_company
from mlvc.pages.home_page import render as render_home
from mlvc.pages.predict_page import render as render_predict
from mlvc.pages.unsupervised_learning_page import render as render_unsupervised
app = dash.Dash(
__name__,
suppress_callback_exceptions=True,
external_stylesheets=[dbc.themes.BOOTSTRAP])
server = app.server
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content'),
html.Img(id="image")
])
@app.callback(Output('page-content', 'children'), Input('url', 'pathname'))
def routing(pathname):
if pathname == '/':
return render_home()
elif pathname == '/home':
return render_home()
elif pathname == '/company':
return render_company()
elif pathname == '/predict':
return render_predict()
elif pathname == '/unsupervised':
return render_unsupervised()
else:
pass
def main():
app.run_server(debug=True, port=30000)
if __name__ == '__main__':
main()