Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

my_app.py 1.5 KB

You have to be logged in to leave a comment. Sign In
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
  1. #############################################################
  2. # my_app.py : Main web app launching script for mapping seagrass meadows
  3. # Date : 29/02/2024
  4. #############################################################
  5. import dash
  6. from dash import html, dcc
  7. import dash_bootstrap_components as dbc
  8. app = dash.Dash(__name__, use_pages=True,meta_tags=[
  9. {"name": "viewport", "content": "width=device-width, initial-scale=1"}
  10. ] ,external_stylesheets=[dbc.themes.LUX])
  11. server = app.server
  12. from navbar import create_navbar
  13. NAVBAR = create_navbar()
  14. sidebar = dbc.Nav(
  15. [
  16. dbc.NavLink(
  17. [
  18. html.Div(page["name"], className="ms-2"),
  19. ],
  20. href=page["path"],
  21. active="exact",
  22. )
  23. for page in dash.page_registry.values()
  24. ],
  25. vertical=True,
  26. pills=True,
  27. className="bg-light",
  28. )
  29. #get logo icon
  30. plotly_logo = "https://images.plot.ly/logo/new-branding/plotly-logomark.png"
  31. app.layout = dbc.Container([
  32. dbc.Row(NAVBAR),
  33. html.Hr(),
  34. dbc.Row(
  35. [
  36. dbc.Col(
  37. [
  38. sidebar
  39. ], xs=4, sm=4, md=2, lg=2, xl=2, xxl=2),
  40. dbc.Col(
  41. [
  42. dash.page_container
  43. ], xs=8, sm=8, md=10, lg=10, xl=10, xxl=10)
  44. ]
  45. )
  46. ], fluid=True)
  47. if __name__ == "__main__":
  48. app.run(debug=True, port=8051)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...