-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathapp.py
44 lines (33 loc) · 1.28 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
import warnings
import dash
from dash import html, dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
import plotly.io as pio
import navigation, footer
warnings.simplefilter(action="ignore", category=FutureWarning)
pio.templates.default = "plotly_white"
app = dash.Dash(
__name__,
use_pages=True,
update_title="Loading okama ...",
external_stylesheets=[dbc.themes.BOOTSTRAP, dbc.icons.BOOTSTRAP],
# suppress_callback_exceptions=True
)
server = app.server
app.layout = html.Div([dcc.Store(id="store"), navigation.navbar, dash.page_container, footer.footer()])
app.clientside_callback(
"""
function(trigger) {
// can use any prop to trigger this callback - we just want to store the info on startup
const inner_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
const inner_height = window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight;
const screenInfo = {height :screen.height, width: screen.width, in_width: inner_width, in_height: inner_height};
return screenInfo
}
""",
Output("store", "data"),
Input("store", "data"),
)
if __name__ == "__main__":
app.run_server(debug=True, port=8050)