Skip to content

Commit bac2463

Browse files
committed
tSNE: Redraw plot every two seconds
1 parent f1eda08 commit bac2463

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Orange/widgets/unsupervised/owtsne.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ def __init__(self):
110110
self.__in_next_step = False
111111
self.__draw_similar_pairs = False
112112

113+
def reset_needs_to_draw():
114+
self.needs_to_draw = True
115+
116+
self.needs_to_draw = True
117+
self.__timer_draw = QTimer(self, interval=2000,
118+
timeout=reset_needs_to_draw)
119+
113120
def _add_controls(self):
114121
self._add_controls_start_box()
115122
super()._add_controls()
@@ -309,6 +316,7 @@ def __set_update_loop(self, loop):
309316
self.runbutton.setText("Stop")
310317
self.__state = OWtSNE.Running
311318
self.__timer.start()
319+
self.__timer_draw.start()
312320
else:
313321
self.setBlocking(False)
314322
self.setStatusMessage("")
@@ -317,6 +325,7 @@ def __set_update_loop(self, loop):
317325
if self.__state == OWtSNE.Paused:
318326
self.runbutton.setText("Resume")
319327
self.__timer.stop()
328+
self.__timer_draw.stop()
320329

321330
def __next_step(self):
322331
if self.__update_loop is None:

0 commit comments

Comments
 (0)