Skip to content

Commit 7334132

Browse files
committed
feat: Update widget properties to use 'name' instead of 'label' for consistency in MultiGeoAnimatorManager and GeoAnimatorManager
1 parent 3fb8074 commit 7334132

2 files changed

Lines changed: 39 additions & 39 deletions

File tree

dvue/animator/multi_ui.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,12 @@ def __init__(
474474
self._time_label_pane = pn.pane.Bokeh(
475475
self._time_div, sizing_mode="stretch_width")
476476
self._time_slider = pn.widgets.DiscretePlayer(
477-
label="", options=list(range(len(ti))), value=0,
477+
name="", options=list(range(len(ti))), value=0,
478478
interval=500, loop_policy="once", show_value=False,
479479
sizing_mode="stretch_width",
480480
)
481481
self._datetime_picker = pn.widgets.DatetimePicker(
482-
label="Go to date/time",
482+
name="Go to date/time",
483483
value=ti[0].to_pydatetime(),
484484
start=ti[0].to_pydatetime(), end=ti[-1].to_pydatetime(),
485485
sizing_mode="stretch_width",
@@ -489,25 +489,25 @@ def __init__(
489489
# 11. Style + diff controls
490490
# ----------------------------------------------------------------
491491
self._clim_input = pn.widgets.TextInput(
492-
label="Color range (min, max)",
492+
name="Color range (min, max)",
493493
value=f"{eff_vmin:.4g}, {eff_vmax:.4g}",
494494
sizing_mode="stretch_width",
495495
)
496496
self._colormap_select = pn.widgets.Select(
497-
label="Colormap", options=CURATED_COLORMAPS_WITH_SEP, value=colormap,
497+
name="Colormap", options=CURATED_COLORMAPS_WITH_SEP, value=colormap,
498498
sizing_mode="stretch_width",
499499
)
500500
self._diff_colormap_select = pn.widgets.Select(
501-
label="Diff colormap", options=CURATED_COLORMAPS_WITH_SEP, value=diff_colormap,
501+
name="Diff colormap", options=CURATED_COLORMAPS_WITH_SEP, value=diff_colormap,
502502
sizing_mode="stretch_width", visible=show_diff,
503503
)
504504
self._show_diff_check = pn.widgets.Checkbox(
505-
label="Show diff (A \u2212 B)", value=show_diff,
505+
name="Show diff (A \u2212 B)", value=show_diff,
506506
sizing_mode="stretch_width",
507507
)
508508
_transform_names = ["none"] + list(self._transform_options.keys())
509509
self._transform_select = pn.widgets.Select(
510-
label="Transform", options=_transform_names,
510+
name="Transform", options=_transform_names,
511511
value=initial_transform if initial_transform in _transform_names else "none",
512512
sizing_mode="stretch_width",
513513
visible=bool(self._transform_options),
@@ -517,40 +517,40 @@ def __init__(
517517
# 12. Contour controls (shared for both maps)
518518
# ----------------------------------------------------------------
519519
self._contours_check = pn.widgets.Checkbox(
520-
label="Show contours", value=False, sizing_mode="stretch_width",
520+
name="Show contours", value=False, sizing_mode="stretch_width",
521521
)
522522
self._contour_color_check = pn.widgets.Checkbox(
523-
label="Color contours (colormap)", value=True,
523+
name="Color contours (colormap)", value=True,
524524
sizing_mode="stretch_width", visible=False,
525525
)
526526
self._n_contours_slider = pn.widgets.IntSlider(
527-
label="Contour levels", start=2, end=30, step=1, value=8,
527+
name="Contour levels", start=2, end=30, step=1, value=8,
528528
sizing_mode="stretch_width", visible=False,
529529
)
530530
self._contour_smooth_slider = pn.widgets.FloatSlider(
531-
label="Contour smoothing", start=0.0, end=20.0, step=0.5, value=3.0,
531+
name="Contour smoothing", start=0.0, end=20.0, step=0.5, value=3.0,
532532
sizing_mode="stretch_width", visible=False,
533533
)
534534
self._contour_levels_select = pn.widgets.Select(
535-
label="Contour level mode",
535+
name="Contour level mode",
536536
options=["linear", "nice", "eq_hist"], value="nice",
537537
sizing_mode="stretch_width", visible=False,
538538
)
539539
self._contour_custom_input = pn.widgets.TextInput(
540-
label="Custom levels (comma-separated)",
540+
name="Custom levels (comma-separated)",
541541
placeholder="e.g. 500, 1000, 2000",
542542
sizing_mode="stretch_width", visible=False,
543543
)
544544
self._contour_labels_check = pn.widgets.Checkbox(
545-
label="Label contours", value=False,
545+
name="Label contours", value=False,
546546
sizing_mode="stretch_width", visible=False,
547547
)
548548
# Show / hide toggles for channels and basemap (all three figures).
549549
self._show_channels_check = pn.widgets.Checkbox(
550-
label="Show channels", value=True, sizing_mode="stretch_width",
550+
name="Show channels", value=True, sizing_mode="stretch_width",
551551
)
552552
self._show_basemap_check = pn.widgets.Checkbox(
553-
label="Show background map", value=True, sizing_mode="stretch_width",
553+
name="Show background map", value=True, sizing_mode="stretch_width",
554554
)
555555

556556
# ----------------------------------------------------------------
@@ -593,13 +593,13 @@ def __init__(
593593
# Save config card — at the bottom; filled in by dsm2ui after construction.
594594
self._animate_meta: dict = {}
595595
self._config_path_input = pn.widgets.TextInput(
596-
label="Save path (.yml)",
596+
name="Save path (.yml)",
597597
placeholder="/path/to/config.yml",
598598
sizing_mode="stretch_width",
599599
)
600600
self._save_config_btn = pn.widgets.Button(
601-
label="Save config to YAML",
602-
color="primary",
601+
name="Save config to YAML",
602+
button_type="primary",
603603
sizing_mode="stretch_width",
604604
)
605605
self._save_config_status = pn.pane.Markdown("", sizing_mode="stretch_width")

dvue/animator/ui.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def __init__(
690690
)
691691
self._time_label_pane = pn.pane.Bokeh(self._time_div, sizing_mode="stretch_width")
692692
self._time_slider = pn.widgets.DiscretePlayer(
693-
label="",
693+
name="",
694694
options=list(range(len(ti))),
695695
value=0,
696696
interval=500, # ms between steps when playing
@@ -701,67 +701,67 @@ def __init__(
701701
# DatetimePicker — lets the user jump directly to any date/time.
702702
# Synced bidirectionally with the DiscretePlayer (snaps to nearest step).
703703
self._datetime_picker = pn.widgets.DatetimePicker(
704-
label="Go to date/time",
704+
name="Go to date/time",
705705
value=ti[0].to_pydatetime(),
706706
start=ti[0].to_pydatetime(),
707707
end=ti[-1].to_pydatetime(),
708708
sizing_mode="stretch_width",
709709
)
710710
self._clim_input = pn.widgets.TextInput(
711-
label="Color range (min, max)",
711+
name="Color range (min, max)",
712712
value=f"{init_vmin:.4g}, {init_vmax:.4g}",
713713
sizing_mode="stretch_width",
714714
)
715715
self._colormap_select = pn.widgets.Select(
716-
label="Colormap", options=CURATED_COLORMAPS_WITH_SEP, value=colormap,
716+
name="Colormap", options=CURATED_COLORMAPS_WITH_SEP, value=colormap,
717717
sizing_mode="stretch_width",
718718
)
719719
self._size_slider = pn.widgets.FloatSlider(
720-
label="Size" if self._geom_type == "point" else "Line width",
720+
name="Size" if self._geom_type == "point" else "Line width",
721721
start=1.0, end=50.0, step=0.5, value=size,
722722
sizing_mode="stretch_width",
723723
)
724724
self._contours_check = pn.widgets.Checkbox(
725-
label="Show contours", value=False, sizing_mode="stretch_width",
725+
name="Show contours", value=False, sizing_mode="stretch_width",
726726
)
727727
self._contour_color_check = pn.widgets.Checkbox(
728-
label="Color contours (colormap)", value=True,
728+
name="Color contours (colormap)", value=True,
729729
sizing_mode="stretch_width", visible=False,
730730
)
731731
self._n_contours_slider = pn.widgets.IntSlider(
732-
label="Contour levels", start=2, end=30, step=1, value=8,
732+
name="Contour levels", start=2, end=30, step=1, value=8,
733733
sizing_mode="stretch_width", visible=False,
734734
)
735735
self._contour_smooth_slider = pn.widgets.FloatSlider(
736-
label="Contour smoothing", start=0.0, end=20.0, step=0.5, value=3.0,
736+
name="Contour smoothing", start=0.0, end=20.0, step=0.5, value=3.0,
737737
sizing_mode="stretch_width", visible=False,
738738
)
739739
self._contour_levels_select = pn.widgets.Select(
740-
label="Contour level mode",
740+
name="Contour level mode",
741741
options=["linear", "nice", "eq_hist"],
742742
value="nice",
743743
sizing_mode="stretch_width", visible=False,
744744
)
745745
self._contour_custom_input = pn.widgets.TextInput(
746-
label="Custom levels (comma-separated)",
746+
name="Custom levels (comma-separated)",
747747
placeholder="e.g. 500, 1000, 2000",
748748
sizing_mode="stretch_width", visible=False,
749749
)
750750
self._contour_labels_check = pn.widgets.Checkbox(
751-
label="Label contours", value=False,
751+
name="Label contours", value=False,
752752
sizing_mode="stretch_width", visible=False,
753753
)
754754
# Channel visibility toggle — always shown.
755755
self._show_channels_check = pn.widgets.Checkbox(
756-
label="Show channels", value=True, sizing_mode="stretch_width",
756+
name="Show channels", value=True, sizing_mode="stretch_width",
757757
)
758758
self._show_basemap_check = pn.widgets.Checkbox(
759-
label="Show background map", value=True, sizing_mode="stretch_width",
759+
name="Show background map", value=True, sizing_mode="stretch_width",
760760
)
761761
# Transform selector — only shown when transform_options is provided
762762
_transform_names = ["none"] + list(self._transform_options.keys())
763763
self._transform_select = pn.widgets.Select(
764-
label="Transform",
764+
name="Transform",
765765
options=_transform_names,
766766
value=initial_transform if initial_transform in _transform_names else "none",
767767
sizing_mode="stretch_width",
@@ -770,11 +770,11 @@ def __init__(
770770
# X2 controls — only shown when an x2_callback is provided.
771771
_has_x2 = x2_callback is not None
772772
self._x2_check = pn.widgets.Checkbox(
773-
label="Show X2 line", value=False,
773+
name="Show X2 line", value=False,
774774
sizing_mode="stretch_width", visible=_has_x2,
775775
)
776776
self._x2_threshold_input = pn.widgets.FloatInput(
777-
label="X2 threshold", value=2700.0,
777+
name="X2 threshold", value=2700.0,
778778
sizing_mode="stretch_width", visible=False,
779779
)
780780

@@ -824,13 +824,13 @@ def __init__(
824824
# Save config card — at the bottom; filled in by dsm2ui after construction.
825825
self._animate_meta: dict = {}
826826
self._config_path_input = pn.widgets.TextInput(
827-
label="Save path (.yml)",
827+
name="Save path (.yml)",
828828
placeholder="/path/to/config.yml",
829829
sizing_mode="stretch_width",
830830
)
831831
self._save_config_btn = pn.widgets.Button(
832-
label="Save config to YAML",
833-
color="primary",
832+
name="Save config to YAML",
833+
button_type="primary",
834834
sizing_mode="stretch_width",
835835
)
836836
self._save_config_status = pn.pane.Markdown("", sizing_mode="stretch_width")

0 commit comments

Comments
 (0)