Skip to content

Commit e92ff85

Browse files
committed
PaintData: Save painted data to schema
1 parent ebd003a commit e92ff85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Orange/widgets/data/owpaintdata.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,14 @@ class OWPaintData(widget.OWWidget):
774774
brushRadius = Setting(75)
775775
density = Setting(7)
776776

777+
data = Setting(None, schema_only=True)
778+
777779
graph_name = "plot"
778780

779781
def __init__(self):
780782
super().__init__()
781783

782-
self.data = self.input_data = None
784+
self.input_data = None
783785
self.input_classes = []
784786
self.input_has_attr2 = True
785787
self.current_tool = None
@@ -799,12 +801,14 @@ def __init__(self):
799801
self.class_model.rowsInserted.connect(self._class_count_changed)
800802
self.class_model.rowsRemoved.connect(self._class_count_changed)
801803

802-
self.data = np.zeros((0, 3))
804+
if self.data is None:
805+
self.data = np.zeros((0, 3))
803806
self.colors = colorpalette.ColorPaletteGenerator(
804807
len(colorpalette.DefaultRGBColors))
805808
self.tools_cache = {}
806809

807810
self._init_ui()
811+
self.commit()
808812

809813
def _init_ui(self):
810814
namesBox = gui.vBox(self.controlArea, "Names")

0 commit comments

Comments
 (0)