Skip to content

Commit 359b104

Browse files
committed
Fix feature scatter init
1 parent 4aa8917 commit 359b104

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/napari_matplotlib/scatter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ class FeaturesScatterWidget(ScatterBaseWidget):
110110

111111
def __init__(self, napari_viewer: napari.viewer.Viewer):
112112
super().__init__(napari_viewer)
113-
114113
self._key_selection_widget = magicgui(
115114
self._set_axis_keys,
116115
x_axis_key={"choices": self._get_valid_axis_keys},
117116
y_axis_key={"choices": self._get_valid_axis_keys},
118117
call_button="plot",
119118
)
119+
120120
self.layout().addWidget(self._key_selection_widget.native)
121121

122122
@property
@@ -202,7 +202,7 @@ def _on_update_layers(self) -> None:
202202
This is called when the layer selection changes by
203203
``self.update_layers()``.
204204
"""
205-
if self._key_selection_widget is not None:
205+
if hasattr(self, "_key_selection_widget"):
206206
self._key_selection_widget.reset_choices()
207207

208208
# reset the axis keys

0 commit comments

Comments
 (0)