Skip to content

Commit

Permalink
Enable various animations
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Dec 3, 2018
1 parent 0384bde commit a04b405
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Orange/widgets/visualize/owscatterplotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a04b405

Please sign in to comment.