Skip to content

Commit f20772b

Browse files
committed
update
1 parent e5c8760 commit f20772b

File tree

8 files changed

+791
-743
lines changed

8 files changed

+791
-743
lines changed

app.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,17 @@
8080
from view_callbacks.parcats_view import get_parcats_view_callbacks
8181
from view_callbacks.violin_view import get_violin_view_callbacks
8282

83+
from app_config import app
8384
from app_config import APP_TITLE, DATA_PATH, CACHE_KEYS
8485
from app_config import SPECIAL_FOLDERS
8586

8687
from layouts.app_layout import get_app_layout
8788

8889

89-
app = dash.Dash(
90-
__name__,
91-
meta_tags=[{"name": "viewport", "content": "width=device-width,initial-scale=1"}],
92-
)
9390
app.scripts.config.serve_locally = True
9491
app.css.config.serve_locally = True
9592
app.title = APP_TITLE
96-
app.layout = get_app_layout(app)
93+
app.layout = get_app_layout
9794

9895

9996
@app.server.route("/api/data/<session>/<start_index>", methods=["GET"])

app_config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
import os
4949

50+
import dash
5051
from dash import DiskcacheManager
5152
from dash.dependencies import Output, State
5253

@@ -90,6 +91,12 @@
9091
dash_cache = Cache(DASH_CACHE_PATH, timeout=120, eviction_policy="none")
9192
background_callback_manager = DiskcacheManager(dash_cache)
9293

94+
95+
app = dash.Dash(
96+
__name__,
97+
meta_tags=[{"name": "viewport", "content": "width=device-width,initial-scale=1"}],
98+
)
99+
93100
# options for dropdown components with all the keys
94101
DROPDOWN_OPTIONS_ALL = [
95102
Output("c-picker-3d", "options"),

layouts/app_layout.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@
6363

6464
from app_config import APP_VERSION
6565

66-
from layouts.modal_layout import modal
66+
from layouts.modal_layout import get_modal_layout
6767
from layouts.header_layout import get_header_layout
68-
from layouts.view3d_card_layout import view3d_card
69-
from layouts.left2d_card_layout import left2d_card
70-
from layouts.right2d_card_layout import right2d_card
68+
from layouts.view3d_card_layout import get_view3d_card_layout
69+
from layouts.left2d_card_layout import get_left2d_card_layout
70+
from layouts.right2d_card_layout import get_right2d_card_layout
7171
from layouts.hist_card_layout import hist_card
7272
from layouts.violin_card_layout import violin_card
7373
from layouts.parallel_card_layout import parallel_card
7474
from layouts.heatmap_card_layout import get_heatmap_card
7575

7676

77-
def get_app_layout(app):
77+
def get_app_layout():
7878
"""
7979
Get the layout for the Dash app.
8080
@@ -111,10 +111,12 @@ def get_app_layout(app):
111111
dcc.Store(id="local-buffer-index", data=-1),
112112
dcc.Store(id="worker-status"),
113113
dcc.Download(id="download"),
114-
modal,
115-
get_header_layout(app),
116-
view3d_card,
117-
dbc.CardGroup([left2d_card, right2d_card], className="mb-3"),
114+
get_modal_layout(),
115+
get_header_layout(),
116+
get_view3d_card_layout(),
117+
dbc.CardGroup(
118+
[get_left2d_card_layout(), get_right2d_card_layout()], className="mb-3"
119+
),
118120
dbc.CardGroup([hist_card, violin_card], className="mb-3"),
119121
dbc.CardGroup([parallel_card, get_heatmap_card()], className="mb-3"),
120122
html.Hr(),

layouts/header_layout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@
3737

3838
import dash_bootstrap_components as dbc
3939

40+
from app_config import app
4041
from app_config import APP_TITLE, THEME
4142

4243

43-
def get_header_layout(app):
44+
def get_header_layout():
4445
"""
4546
Creates the header layout for the SensorView dashboard using Dash Bootstrap Components.
4647
@@ -51,7 +52,7 @@ def get_header_layout(app):
5152
- Dropdown for adding additional log files with tooltips.
5253
5354
Args:
54-
app: The Dash app instance, used to resolve asset URLs.
55+
None
5556
5657
Returns:
5758
A dbc.Row object representing the header layout.

0 commit comments

Comments
 (0)