Skip to content

Commit

Permalink
OWHeatMap: Store and retrieve selections
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Aug 1, 2019
1 parent dd4b0b5 commit 6dddb3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Orange/widgets/visualize/owheatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ class Outputs:

palette_index = settings.Setting(_default_palette_index)
column_label_pos = settings.Setting(PositionTop)
selected_rows = settings.Setting(None, schema_only=True)

auto_commit = settings.Setting(True)

Expand Down Expand Up @@ -454,6 +455,7 @@ class Warning(widget.OWWidget.Warning):

def __init__(self):
super().__init__()
self.__pending_selection = self.selected_rows

# set default settings
self.space_x = 10
Expand Down Expand Up @@ -719,7 +721,13 @@ def set_dataset(self, data=None):
self.openContext(self.data)
if self.annotation_index >= len(self.annotation_vars):
self.annotation_index = 0

self.update_heatmaps()
if data is not None and self.__pending_selection is not None:
self.selection_manager.select_rows(self.__pending_selection)
self.selected_rows = self.__pending_selection
self.__pending_selection = None

self.unconditional_commit()

def update_heatmaps(self):
Expand Down

0 comments on commit 6dddb3b

Please sign in to comment.