def register_dashapps(app): from app.dashapp1.layout import layout from app.dashapp1.callbacks import register_callbacks from app.dashapp2.layout import layout as layout2 from app.dashapp2.callbacks import register_callbacks as register_callbacks2 # Meta tags for viewport responsiveness meta_viewport = { "name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no" } dashapp1 = dash.Dash(__name__, server=app, url_base_pathname='/dashapps/dashboard/', assets_folder=get_root_path(__name__) + '/dashboard/assets/', meta_tags=[meta_viewport]) dashapp2 = dash.Dash(__name__, server=app, url_base_pathname='/dashapps/dashboard2/', assets_folder=get_root_path(__name__) + '/dashapps/dashboard2/assets/', meta_tags=[meta_viewport]) with app.app_context(): dashapp1.title = 'Dashapp 1' dashapp1.layout = layout register_callbacks(dashapp1) with app.app_context(): dashapp2.title = 'Dashapp 2' dashapp2.layout = layout2 register_callbacks2(dashapp2)
def register_dashapps(app): from app.dashapp1.layout import layout from app.dashapp1.callbacks import register_callbacks # Meta tags for viewport responsiveness meta_viewport = { "name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no" } dashapp1 = dash.Dash( __name__, server=app, url_base_pathname='/dashboard/', assets_folder=get_root_path(__name__) + '/dashapp1/assets/', external_stylesheets=[ '/Users/tenzinlhakhang/Desktop/Projects/flask.dash.test/dash_on_flask/app/dashapp1/assets/bootstrap.css' ], meta_tags=[meta_viewport]) with app.app_context(): dashapp1.title = 'Dashapp 1' dashapp1.layout = layout suppress_callback_exceptions = True register_callbacks(dashapp1) suppress_callback_exceptions = True #application = dashapp1.server _protect_dashviews(dashapp1)
def test_ui008_playlist_drop(dash_duo): from app.dashapp1.callbacks import register_callbacks app = dash.Dash(__name__) app.layout = layout register_callbacks(app) dash_duo.start_server(app) dash_duo.driver.maximize_window() dash_duo.wait_for_contains_text('#second', "What", timeout=5) dash_duo.select_dcc_dropdown('#radar-dropdown', index=0)
def register_dashapps(app): ### App1 = Story 1 ################################################# from app.dashapp1.layout import layout from app.dashapp1.callbacks import register_callbacks # Meta tags for viewport responsiveness meta_viewport = { "name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no" } dashapp1 = dash.Dash(__name__, server=app, url_base_pathname='/story1/', assets_folder=get_root_path(__name__) + '/story1/assets/', meta_tags=[meta_viewport], external_stylesheets=THEME) with app.app_context(): dashapp1.title = 'Medium Data Science Journey - Story 1' dashapp1.layout = layout register_callbacks(dashapp1) _protect_dashviews(dashapp1) ### App2 = Story 2 ################################################# from app.dashapp2.layout import layout from app.dashapp2.callbacks import register_callbacks # Meta tags for viewport responsiveness meta_viewport = { "name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no" } dashapp2 = dash.Dash(__name__, server=app, url_base_pathname='/story2/', assets_folder=get_root_path(__name__) + '/story2/assets/', meta_tags=[meta_viewport], external_stylesheets=THEME) with app.app_context(): dashapp2.title = 'Medium Data Science Journey - Story 2' dashapp2.layout = layout register_callbacks(dashapp2) _protect_dashviews(dashapp2)
def register_dashapps(app): from app.dashapp1.layout import layout from app.dashapp1.callbacks import register_callbacks # Meta tags for viewport responsiveness meta_viewport = {"name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no"} dashapp1 = dash.Dash(__name__, server=app, url_base_pathname='/dashboard/', assets_folder=get_root_path(__name__) + '/dashboard/assets/', meta_tags=[meta_viewport], external_stylesheets=external_stylesheets) with app.app_context(): dashapp1.title = 'Pictojams' dashapp1.layout = layout register_callbacks(dashapp1)
def register_dashapps(app): from app.dashapp1.layout import layout from app.dashapp1.callbacks import register_callbacks # Meta tags for viewport responsiveness meta_viewport = { "name": "viewport", "content": "width=device-width, initial-scale=1, shrink-to-fit=no", } dashapp1 = dash.Dash( __name__, server=app, url_base_pathname="/dashboard/", assets_folder=get_root_path(__name__) + "/dashboard/assets/", meta_tags=[meta_viewport], ) dashapp1.title = "Dashapp 1" dashapp1.layout = layout register_callbacks(dashapp1) _protect_dashviews(dashapp1)
def test_ui008_playlist_drop(dash_duo): from app.dashapp1.callbacks import register_callbacks app = dash.Dash(__name__) app.layout = layout register_callbacks(app) dash_duo.start_server(app) dash_duo.driver.maximize_window() dash_duo.wait_for_contains_text('#six', "What", timeout=5) dash_duo.select_dcc_dropdown('#mood-dropdown', index=0) ## ----- # def test_ui002_second_univariate_plot_frequency(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_contains_text('#plot_selector', "frequency plot", timeout=5) # dash_duo.wait_for_contains_text('#second_explore_plot', "plotly-logomark", timeout=5) # def test_ui009_second_univariate_plot_box_gives_select_score_prompt(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_contains_text('#plot_selector', "frequency plot", timeout=5) # dash_duo.select_dcc_dropdown('#expl_category_selector', index=1) # dash_duo.find_element("#expl_continuous_selector span.Select-clear").click() # dash_duo.wait_for_contains_text('#second_explore_plot', "select a score", timeout=5) # def test_ui003_second_univariate_plot_box(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_contains_text('#plot_selector', "frequency plot", timeout=5) # dash_duo.select_dcc_dropdown('#plot_selector', index=0) # short_text = dash_duo.find_element('#expl_continuous_selector').text # short_text, _ = re.compile(r"[^a-zA-Z \-']").subn('', short_text) # dash_duo.wait_for_contains_text('#second_explore_plot', short_text, timeout=5) # def test_ui004_histogram_plot(dash_duo): # dash_duo.start_server(app) # dash_duo.select_dcc_dropdown('#continuous_selector', index=1) # dash_duo.wait_for_element('#width_slider', timeout=5) # dash_duo.wait_for_element('#hist_plot', timeout=5) # def test_ui005_four_blocks(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_element('#info-container', timeout=5) # def test_ui006_report(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_element('#open-xl', timeout=5) # dash_duo.wait_for_element('#report', timeout=5) # def test_ui011_prediction_plot(dash_duo): # dash_duo.start_server(app) # dash_duo.wait_for_contains_text('#ml_prediction_plot', "Science self-efficacy", timeout=10)