Skip to content

Commit 7bb467a

Browse files
committed
update spectrum viewer
1 parent 7783d92 commit 7bb467a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/serve/panels-demo/demo_panels/panel_spectrum.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
panel = Panel(__name__, title="Spectrum View (Demo)", icon="light", position=4)
2929

30-
THROTTLE_TOTAL_SPECTRUM_PLOTS = 10
30+
_THROTTLE_TOTAL_SPECTRUM_PLOTS = 10
3131

3232

3333
@panel.layout(
@@ -190,10 +190,10 @@ def update_text(
190190
Input("@app", "selectedTimeLabel"),
191191
Input("@app", "selectedPlaceGeometry"),
192192
State("@app", "selectedPlaceGroup"),
193-
Input("exploration_radio_group", "value"),
194-
State("plot", "chart"),
195193
State("@container", "spectrum_list"),
196194
State("@container", "previous_mode"),
195+
Input("exploration_radio_group", "value"),
196+
State("plot", "chart"),
197197
Output("plot", "chart"),
198198
Output("error_message", "children"),
199199
Output("@container", "spectrum_list"),
@@ -205,12 +205,11 @@ def update_plot(
205205
time_label: str | None = None,
206206
place_geo: dict[str, Any] | None = None,
207207
place_group: list[dict[str, Any]] | None = None,
208-
exploration_radio_group: str | None = None,
209-
current_chart: alt.Chart | None = None,
210208
spectrum_list: list[str] | None = None,
211209
previous_mode: str | None = None,
210+
exploration_radio_group: str | None = None,
211+
current_chart: alt.Chart | None = None,
212212
) -> tuple[alt.Chart | None, str, list, str]:
213-
print("spectrum list", spectrum_list)
214213
if exploration_radio_group is None:
215214
return None, "Missing exploration mode choice", spectrum_list, previous_mode
216215

@@ -306,7 +305,9 @@ def update_plot(
306305
return new_chart, "", spectrum_list, previous_mode
307306

308307

309-
def find_selected_point_label(features_data, target_point) -> str | None:
308+
def find_selected_point_label(
309+
features_data: list[dict[str, Any]], target_point: dict[str, Any]
310+
) -> str | None:
310311
for feature_collection in features_data:
311312
for feature in feature_collection.get("features", []):
312313
geometry = feature.get("geometry", {})
@@ -386,7 +387,7 @@ def add_place_data_to_existing(
386387
final_df = combined_data[
387388
combined_data["places"].isin(
388389
combined_data.drop_duplicates("places", keep="last").tail(
389-
THROTTLE_TOTAL_SPECTRUM_PLOTS
390+
_THROTTLE_TOTAL_SPECTRUM_PLOTS
390391
)["places"]
391392
)
392393
]

0 commit comments

Comments
 (0)