Skip to content

Commit

Permalink
Visual settings dialog: Save parameters as schema-only settings
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Jun 18, 2020
1 parent 206049f commit c9f9d47
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Orange/widgets/evaluate/owcalibrationplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class Information(widget.OWWidget.Information):
fold_curves = settings.Setting(False)
display_rug = settings.Setting(True)
threshold = settings.Setting(0.5)
visual_settings = settings.Setting({}, schema_only=True)
auto_commit = settings.Setting(True)

graph_name = "plot"
Expand Down Expand Up @@ -564,8 +565,9 @@ def send_report(self):
if self.score != 0:
self.report_raw(self.get_info_text(short=False))

def set_visual_settings(self, *args):
self.plot.set_parameter(*args)
def set_visual_settings(self, key, value):
self.plot.set_parameter(key, value)
self.visual_settings[key] = value


def gaussian_smoother(x, y, sigma=1.0):
Expand Down
6 changes: 4 additions & 2 deletions Orange/widgets/visualize/owlineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ class Outputs:
show_error = Setting(False)
auto_commit = Setting(True)
selection = Setting(None, schema_only=True)
visual_settings = Setting({}, schema_only=True)

graph_name = "graph.plotItem"

Expand Down Expand Up @@ -855,8 +856,9 @@ def clear(self):
def __in(obj, collection):
return collection is not None and obj in collection

def set_visual_settings(self, *args):
self.graph.set_parameter(*args)
def set_visual_settings(self, key, value):
self.graph.set_parameter(key, value)
self.visual_settings[key] = value


if __name__ == "__main__":
Expand Down
8 changes: 5 additions & 3 deletions Orange/widgets/visualize/utils/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ class Warning(OWProjectionWidgetBase.Warning):

settingsHandler = DomainContextHandler()
selection = Setting(None, schema_only=True)
visual_settings = Setting({}, schema_only=True)
auto_commit = Setting(True)

GRAPH_CLASS = OWScatterPlotBase
Expand Down Expand Up @@ -625,8 +626,9 @@ def _get_send_report_caption(self):
"{} %".format(self.graph.jitter_size))))

# Customize plot
def set_visual_settings(self, *args):
self.graph.set_parameter(*args)
def set_visual_settings(self, key, value):
self.graph.set_parameter(key, value)
self.visual_settings[key] = value

@staticmethod
def _get_caption_var_name(var):
Expand Down Expand Up @@ -664,8 +666,8 @@ class Error(OWDataProjectionWidget.Error):
proj_error = Msg("An error occurred while projecting data.\n{}")

def __init__(self):
super().__init__()
self.projector = self.projection = None
super().__init__()
self.graph.view_box.started.connect(self._manual_move_start)
self.graph.view_box.moved.connect(self._manual_move)
self.graph.view_box.finished.connect(self._manual_move_finish)
Expand Down

0 comments on commit c9f9d47

Please sign in to comment.