Skip to content

Commit ae79ca6

Browse files
committed
update
1 parent 517358b commit ae79ca6

File tree

3 files changed

+51
-15
lines changed

3 files changed

+51
-15
lines changed

app_config.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,6 @@
167167
State("y-picker-violin", "value"),
168168
]
169169

170-
DROPDOWN_STATE_3D_XYZ = [
171-
State("slider-picker-3d", "value"),
172-
State("x-picker-3d", "value"),
173-
State("y-picker-3d", "value"),
174-
State("z-picker-3d", "value"),
175-
]
176-
177-
DROPDOWN_STATE_3D_XYZ_REF = [
178-
State("x-ref-picker-3d", "value"),
179-
State("y-ref-picker-3d", "value"),
180-
State("z-ref-picker-3d", "value"),
181-
]
182-
183170
# options for dropdown components with categorical keys
184171
DROPDOWN_OPTIONS_CAT = [
185172
Output("x-picker-violin", "options"),

data/Example/info.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"z_3d": "Height",
66
"x_ref": "Host_Latitude",
77
"y_ref": "Host_Longitude",
8-
"z_ref": "Height",
98
"keys": {
109
"Height": {
1110
"description": "Height (m)",

view_callbacks/test_case_view.py

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-------------
88
1. Test Case Management:
99
- Test case loading and validation
10-
- Configuration persistence
10+
- Configuration persistence
1111
- Path management
1212
- File selection
1313
@@ -60,6 +60,8 @@
6060
)
6161
from app_config import DROPDOWN_OPTIONS_CAT, DROPDOWN_VALUES_CAT
6262
from app_config import DROPDOWN_OPTIONS_CAT_COLOR, DROPDOWN_VALUES_CAT_COLOR
63+
from app_config import DROPDOWN_OPTIONS_3D_XYZ, DROPDOWN_OPTIONS_3D_XYZ_REF
64+
from app_config import DROPDOWN_VALUES_3D_XYZ, DROPDOWN_VALUES_3D_XYZ_REF
6365
from app_config import background_callback_manager
6466
from app_config import CACHE_KEYS, KEY_TYPES, THEME
6567

@@ -96,6 +98,10 @@ def get_test_case_view_callbacks(app: dash.Dash) -> None:
9698
"dp_vals_cat_color": DROPDOWN_VALUES_CAT_COLOR,
9799
"dp_opts_cat": DROPDOWN_OPTIONS_CAT,
98100
"dp_vals_cat": DROPDOWN_VALUES_CAT,
101+
"dp_opts_num": DROPDOWN_OPTIONS_3D_XYZ,
102+
"dp_vals_num": DROPDOWN_VALUES_3D_XYZ,
103+
"dp_opts_num_with_none": DROPDOWN_OPTIONS_3D_XYZ_REF,
104+
"dp_vals_num_with_none": DROPDOWN_VALUES_3D_XYZ_REF,
99105
},
100106
inputs={
101107
"file": Input("current-file", "data"),
@@ -233,6 +239,46 @@ def file_select_changed(
233239
]
234240
] * len(DROPDOWN_OPTIONS_CAT)
235241

242+
options_num = [
243+
[
244+
{"label": config["keys"][item].get("description", item), "value": item}
245+
for _, item in enumerate(num_keys)
246+
]
247+
] * len(DROPDOWN_OPTIONS_3D_XYZ)
248+
249+
options_num_with_none = [
250+
[{"label": "None", "value": "None"}]
251+
+ [
252+
{"label": config["keys"][item].get("description", item), "value": item}
253+
for _, item in enumerate(num_keys)
254+
]
255+
] * len(DROPDOWN_OPTIONS_3D_XYZ_REF)
256+
257+
if len(num_keys) == 0:
258+
xyz_all = [None] * len(DROPDOWN_VALUES_3D_XYZ)
259+
else:
260+
xyz_all = [
261+
num_keys[x % len(num_keys)]
262+
for x in range(0, len(DROPDOWN_VALUES_3D_XYZ))
263+
]
264+
265+
xyz_all[0] = config.get("slider", xyz_all[0])
266+
xyz_all[1] = config.get("x_3d", xyz_all[1])
267+
xyz_all[2] = config.get("y_3d", xyz_all[2])
268+
xyz_all[3] = config.get("z_3d", xyz_all[3])
269+
270+
if len(num_keys) == 0:
271+
xyz_ref_all = [None] * len(DROPDOWN_VALUES_3D_XYZ_REF)
272+
else:
273+
xyz_ref_all = [
274+
num_keys[x % len(num_keys)]
275+
for x in range(0, len(DROPDOWN_VALUES_3D_XYZ_REF))
276+
]
277+
278+
xyz_ref_all[0] = config.get("x_ref", "None")
279+
xyz_ref_all[1] = config.get("y_ref", "None")
280+
xyz_ref_all[2] = config.get("z_ref", "None")
281+
236282
# values for `DROPDOWN_VALUES_CAT`
237283
if len(cat_keys) == 0:
238284
values_cat = [None] * len(DROPDOWN_VALUES_CAT)
@@ -356,6 +402,10 @@ def file_select_changed(
356402
"dp_vals_cat_color": values_cat_color,
357403
"dp_opts_cat": options_cat,
358404
"dp_vals_cat": values_cat,
405+
"dp_opts_num": options_num,
406+
"dp_vals_num": xyz_all,
407+
"dp_opts_num_with_none": options_num_with_none,
408+
"dp_vals_num_with_none": xyz_ref_all,
359409
}
360410

361411
@app.callback(

0 commit comments

Comments
 (0)