Skip to content

Commit

Permalink
Merge pull request #3886 from robertcv/fix/radviz_labels_num
Browse files Browse the repository at this point in the history
[FIX] OWRadviz: limit number of vars in RadvizVizRank
  • Loading branch information
janezd authored Jun 14, 2019
2 parents c57f851 + a484f9e commit ce754e6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Orange/widgets/visualize/owradviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
from Orange.widgets.visualize.utils.widget import OWAnchorProjectionWidget


MAX_DISPLAYED_VARS = 20
MAX_LABEL_LEN = 16


class RadvizVizRank(VizRankDialog, OWComponent):
captionTitle = "Score Plots"
n_attrs = Setting(3)
Expand All @@ -48,8 +52,9 @@ def __init__(self, master):
self.n_neighbors = 10

box = gui.hBox(self)
max_n_attrs = min(MAX_DISPLAYED_VARS, len(master.model_selected))
self.n_attrs_spin = gui.spin(
box, self, "n_attrs", 3, 99, label="Maximum number of variables: ",
box, self, "n_attrs", 3, max_n_attrs, label="Maximum number of variables: ",
controlWidth=50, alignment=Qt.AlignRight, callback=self._n_attrs_changed)
gui.rubber(box)
self.last_run_n_attrs = None
Expand Down Expand Up @@ -130,7 +135,8 @@ def check_preconditions(self):
return False
elif not master.btn_vizrank.isEnabled():
return False
self.n_attrs_spin.setMaximum(len(master.model_selected))
self.n_attrs_spin.setMaximum(min(MAX_DISPLAYED_VARS,
len(master.model_selected)))
return True

def on_row_clicked(self, index):
Expand Down Expand Up @@ -205,9 +211,6 @@ def stopped(self):
self.n_attrs_spin.setDisabled(False)


MAX_LABEL_LEN = 16


class OWRadvizGraph(OWGraphWithAnchors):
def __init__(self, scatter_widget, parent):
super().__init__(scatter_widget, parent)
Expand Down

0 comments on commit ce754e6

Please sign in to comment.