diff --git a/Orange/widgets/visualize/owscatterplot.py b/Orange/widgets/visualize/owscatterplot.py index 510ce0deb04..54c67ae845c 100644 --- a/Orange/widgets/visualize/owscatterplot.py +++ b/Orange/widgets/visualize/owscatterplot.py @@ -323,8 +323,9 @@ def set_data(self, data): self.vizrank.initialize() self.vizrank.attrs = self.data.domain.attributes if self.data is not None else [] self.vizrank_button.setEnabled( - self.data is not None and self.data.domain.class_var is not None - and len(self.data.domain.attributes) > 1 and len(self.data) > 1) + self.data is not None and not self.data.is_sparse() and + self.data.domain.class_var is not None and + len(self.data.domain.attributes) > 1 and len(self.data) > 1) if self.data is not None and self.data.domain.class_var is None \ and len(self.data.domain.attributes) > 1 and len(self.data) > 1: self.vizrank_button.setToolTip( @@ -423,7 +424,6 @@ def prepare_data(self): new=False) def sparse_to_dense(self, input_data=None): - self.vizrank_button.setEnabled(not (self.data and self.data.is_sparse())) if input_data is None or not input_data.is_sparse(): return input_data keys = [] diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py index f5e01f2304c..45a4b89c0f8 100644 --- a/Orange/widgets/visualize/owscatterplotgraph.py +++ b/Orange/widgets/visualize/owscatterplotgraph.py @@ -989,7 +989,7 @@ def update_shapes(self): self.make_legend() def assure_attribute_present(self, attr): - if attr not in self.data.domain: + if self.data is not None and attr not in self.data.domain: self.master.prepare_data() def update_grid(self):