Skip to content

Commit 415d6c1

Browse files
committed
OWScatterPlot: Remove info message and update VizRank button tooltip
1 parent 9bf3fa0 commit 415d6c1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Orange/widgets/visualize/owscatterplot.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ class ScatterPlotVizRank(VizRankDialogAttrPair):
3838
K = 10
3939

4040
def check_preconditions(self):
41-
if not super().check_preconditions():
41+
if not super().check_preconditions() or \
42+
not self.master.data.domain.class_var:
4243
return False
43-
if not self.master.data.domain.class_var:
44-
self.information(33, "Data with a class variable is required.")
45-
return False
46-
self.master.information(33)
4744
return True
4845

4946
def iterate_states(self, initial_state):
@@ -149,9 +146,10 @@ def __init__(self):
149146
self.vizrank = ScatterPlotVizRank(self)
150147
vizrank_box = gui.hBox(box)
151148
gui.separator(vizrank_box, width=common_options["labelWidth"])
149+
self.vizrank_button_tooltip = "Find informative projections"
152150
self.vizrank_button = gui.button(
153151
vizrank_box, self, "Score Plots", callback=self.vizrank.reshow,
154-
tooltip="Find informative projections", enabled=False)
152+
tooltip=self.vizrank_button_tooltip, enabled=False)
155153
self.vizrank.pairSelected.connect(self.set_attr)
156154

157155
gui.separator(box)
@@ -302,6 +300,12 @@ def set_data(self, data):
302300
self.vizrank_button.setEnabled(
303301
self.data is not None and self.data.domain.class_var is not None
304302
and len(self.data.domain.attributes) > 1 and len(self.data) > 1)
303+
if self.data is not None and self.data.domain.class_var is None \
304+
and len(self.data.domain.attributes) > 1 and len(self.data) > 1:
305+
self.vizrank_button.setToolTip(
306+
"Data with a class variable is required.")
307+
else:
308+
self.vizrank_button.setToolTip(self.vizrank_button_tooltip)
305309
self.openContext(self.data)
306310

307311
def add_data(self, time=0.4):

0 commit comments

Comments
 (0)