From a04b4056c1bcad8336153f6389e7d1b795f74150 Mon Sep 17 00:00:00 2001 From: Vesna Tanko Date: Mon, 3 Dec 2018 15:21:56 +0100 Subject: [PATCH] Enable various animations --- Orange/widgets/visualize/owscatterplotgraph.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py index 7cc505f5d6c..1ed667b6b12 100644 --- a/Orange/widgets/visualize/owscatterplotgraph.py +++ b/Orange/widgets/visualize/owscatterplotgraph.py @@ -737,18 +737,21 @@ def update_sizes(self): diff = size_data - current_size_data class Timeout: - n_iter = 5 + factors = [0.2, 0.4, 0.6, 0.8, 1.0] - def __init__(self, diff_=diff, item=self.scatterplot_item, + def __init__(self, diff_=diff, old_sizes=current_size_data, + item=self.scatterplot_item, item_sel=self.scatterplot_item_sel): self._counter = 0 - self._step = diff_ / self.n_iter + self._diff = diff_ + self._old_sizes = old_sizes.copy() self._scatter_item, self._scatter_item_sel = item, item_sel def __call__(self): + factor = self.factors[self._counter] self._counter += 1 - size = current_size_data + self._step - if self.n_iter == self._counter: + size = self._old_sizes + self._diff * factor + if len(self.factors) == self._counter: tmr.stop() size = size_data self._scatter_item.setSize(size)