Skip to content

Commit

Permalink
Merge pull request #160 from janezd/annotate-graph-name
Browse files Browse the repository at this point in the history
Annotate graph_name with graph's types
  • Loading branch information
janezd committed Apr 5, 2023
2 parents 2061612 + 772073a commit e03a6e6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions orangecontrib/educational/widgets/owgradientdescent.py
Expand Up @@ -92,7 +92,7 @@ class Outputs:
model = Output("Model", Model)
coefficients = Output("Coefficients", Table)

graph_name = "grapH"
graph_name = "graph" # QGraphicsView (pg.PlotWidget)

settingsHandler = settings.DomainContextHandler(
match_values=settings.DomainContextHandler.MATCH_VALUES_CLASS)
Expand Down Expand Up @@ -455,7 +455,7 @@ def send_report(self):
if self.stochastic:
caption_items += (("Stochastic step size", self.step_size),)
caption = report.render_items_vert(caption_items)
self.report_plot(self.graph)
self.report_plot()
self.report_caption(caption)

##############################
Expand Down
4 changes: 2 additions & 2 deletions orangecontrib/educational/widgets/owkmeans.py
Expand Up @@ -180,7 +180,7 @@ class Error(OWWidget.Error):
attr_y = settings.ContextSetting(None)
sound_effects = settings.Setting(False)

graph_name = 'scatter'
graph_name = 'plot' # pg.GraphicsItem (pg.PlotItem)
move_sound = regroup_sound = None

step_trigger = Signal()
Expand Down Expand Up @@ -659,7 +659,7 @@ def send_data(self):
def send_report(self):
if self.data is None:
return
self.report_plot(self.plot)
self.report_plot()


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion orangecontrib/educational/widgets/owpiecharts.py
Expand Up @@ -35,7 +35,7 @@ class Inputs:
attribute = ContextSetting(None)
split_var = ContextSetting(None)
explode = Setting(False)
graph_name = "scene"
graph_name = "scene" # QGraphicsScene

def __init__(self):
super().__init__()
Expand Down
Expand Up @@ -98,7 +98,7 @@ class Outputs(OWBaseLearner.Outputs):
degree = Setting(1)
contours_enabled = Setting(True)

graph_name = 'graph'
graph_name = 'graph.plot_widget' # QGraphicsView (pg.PlotWidget)

class Error(OWBaseLearner.Error):
num_features = Msg("Data must contain at least two numeric variables.")
Expand Down Expand Up @@ -279,7 +279,6 @@ def select_data(self):
self.selected_data = self.selected_data[valid_data]
self.orig_class = self.data.Y[valid_data]


def apply(self):
self.update_model()
self.send_model()
Expand Down Expand Up @@ -544,7 +543,7 @@ def send_report(self):
return
name = "" if self.degree == 1 \
else f"Model with polynomial expansion {self.degree}"
self.report_plot(name=name, plot=self.graph.plot_widget)
self.report_plot(name=name)


if __name__ == "__main__":
Expand Down
Expand Up @@ -190,7 +190,7 @@ class Outputs(OWBaseLearner.Outputs):
regressor_name = ""

want_main_area = True
graph_name = 'plot'
graph_name = 'plot' # pg.GraphicsItem (pg.PlotItem)

class Warning(OWBaseLearner.Warning):
large_diffs = Msg(
Expand Down

0 comments on commit e03a6e6

Please sign in to comment.