aegis_gui.app
1import dash 2import dash_bootstrap_components as dbc 3from aegis_gui import layout 4from aegis_gui.guisettings.GuiSettings import gui_settings 5 6 7@dash.callback( 8 [dash.Output(f"link-nav-{page}", "active") for page in ["home", "config", "plot", "simlog", "wiki"]], 9 [dash.Input("url", "pathname")], 10) 11def toggle_active_links(pathname): 12 if pathname is None: 13 # Default to home if pathname is None 14 pathname = "/" 15 return [ 16 pathname == f"/{page}" or (page == "home" and pathname == "/") 17 for page in ["home", "config", "plot", "simlog", "wiki"] 18 ] 19 20 21def get_app(): 22 app = dash.Dash( 23 __name__, 24 suppress_callback_exceptions=True, 25 update_title="", 26 url_base_pathname=gui_settings.BASE_HREF, 27 external_stylesheets=[ 28 # dbc.themes.BOOTSTRAP, 29 # dbc.icons.BOOTSTRAP, 30 ], # Do not use external_stylesheets 31 assets_ignore="styles-dark.css", # *.css in assets are automatically imported; they need to be explicitly ignored 32 use_pages=True, 33 ) 34 35 # Bootstrap ICONS: https://icons.getbootstrap.com/ 36 37 app._favicon = "favicon.ico" 38 app.title = "AEGIS visualizer" 39 app.layout = layout.get_app_layout() 40 41 return app
@dash.callback([dash.Output(f'link-nav-{page}', 'active') for page in ['home', 'config', 'plot', 'simlog', 'wiki']], [dash.Input('url', 'pathname')])
def
toggle_active_links(pathname):
8@dash.callback( 9 [dash.Output(f"link-nav-{page}", "active") for page in ["home", "config", "plot", "simlog", "wiki"]], 10 [dash.Input("url", "pathname")], 11) 12def toggle_active_links(pathname): 13 if pathname is None: 14 # Default to home if pathname is None 15 pathname = "/" 16 return [ 17 pathname == f"/{page}" or (page == "home" and pathname == "/") 18 for page in ["home", "config", "plot", "simlog", "wiki"] 19 ]
def
get_app():
22def get_app(): 23 app = dash.Dash( 24 __name__, 25 suppress_callback_exceptions=True, 26 update_title="", 27 url_base_pathname=gui_settings.BASE_HREF, 28 external_stylesheets=[ 29 # dbc.themes.BOOTSTRAP, 30 # dbc.icons.BOOTSTRAP, 31 ], # Do not use external_stylesheets 32 assets_ignore="styles-dark.css", # *.css in assets are automatically imported; they need to be explicitly ignored 33 use_pages=True, 34 ) 35 36 # Bootstrap ICONS: https://icons.getbootstrap.com/ 37 38 app._favicon = "favicon.ico" 39 app.title = "AEGIS visualizer" 40 app.layout = layout.get_app_layout() 41 42 return app