-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
64 lines (51 loc) · 1.63 KB
/
run.py
File metadata and controls
64 lines (51 loc) · 1.63 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import flask
import layout
import callbacks
import dash
import dash_bootstrap_components as dbc
external_stylesheets = [dbc.themes.BOOTSTRAP]
server = flask.Flask(__name__)
app = dash.Dash(__name__, server=server, external_stylesheets=external_stylesheets)
app.config.suppress_callback_exceptions = True
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True
app.layout = layout.layout
app.index_string = '''
<!DOCTYPE html>
<html>
<head>
{%metas%}
<title>{%title%}</title>
{%favicon%}
{%css%}
</head>
<body>
<div id='blackout'>
{%app_entry%}
<footer>
{%config%}
{%scripts%}
{%renderer%}
</footer>
</div>
</body>
</html>
'''
@app.server.route('/download/<path:path>')
def download_table(path):
return flask.send_from_directory('.\\', path, attachment_filename='table.csv', as_attachment=True, conditional=True)
functions = []
for opts, funcs in callbacks.Callbacks("BasicLayout", 0)():
functions.append(app.callback(*opts)(funcs))
for opts, funcs in callbacks.Callbacks("Table", 0)():
functions.append(app.callback(*opts)(funcs))
for opts, funcs in callbacks.Callbacks("ScatterTable", 1)():
functions.append(app.callback(*opts)(funcs))
# for i in range(0, 10):
# for opts, funcs in callbacks.Callbacks("ScatterTable", i)():
# functions.append(app.callback(*opts)(funcs))
# for i in range(10, 20):
# for opts, funcs in callbacks.Callbacks("BarTable", i)():
# functions.append(app.callback(*opts)(funcs))
if __name__ == '__main__':
app.run_server(debug=True, threaded=True)