forked from emilhe/dash-extensions-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
31 lines (29 loc) · 1.05 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
from dash_down import GITHUB_MARKDOWN_CSS_LIGHT
from dash_extensions.enrich import DashProxy, Output, Input, page_container
from dash_extensions.snippets import fix_page_load_anchor_issue
from utils.markdown import register_pages
from utils.ui import app_shell
app = DashProxy(__name__, external_stylesheets=[GITHUB_MARKDOWN_CSS_LIGHT], use_pages=True)
# Register component blueprints.
register_pages(app, "getting_started", order_map=dict(installation=0, javascript=1, enrich=2))
register_pages(app, "transforms", order=10)
register_pages(app, "components", order=20)
# Bind layout.
app.layout = app_shell([page_container] + fix_page_load_anchor_issue(app, 500))
# Enable search bar.
app.clientside_callback(
"""
function(value) {
if (value) {
document.getElementById(value).click()
}
return value
}
""",
Output("dummy-container-for-header-select", "children"),
Input("select-component", "value"),
)
# Make server available for gunicorn.
server = app.server
if __name__ == '__main__':
app.run_server(port=7879)