Skip to content

Commit

Permalink
Fix scatterplot selection performance
Browse files Browse the repository at this point in the history
PR #5038 introduced jittering suspension with selection. It introduced a
performance regression, because it needlessly updated point positions
while the selection was being performed. For example, with 10000 data
points, selection was lagging noticeably.
  • Loading branch information
markotoplak committed Jan 22, 2021
1 parent a6e34b2 commit fb44859
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Orange/widgets/visualize/owscatterplotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,16 @@ def update_tooltip(self, modifiers=Qt.NoModifier):
self.tip_textitem.setHtml(text)

def suspend_jittering(self):
prev_state = self.jittering_suspended
self.jittering_suspended = True
self.update_jittering()
if prev_state != self.jittering_suspended and self.jitter_size != 0:
self.update_jittering()

def unsuspend_jittering(self):
prev_state = self.jittering_suspended
self.jittering_suspended = False
self.update_jittering()
if prev_state != self.jittering_suspended and self.jitter_size != 0:
self.update_jittering()

def update_jittering(self):
x, y = self.get_coordinates()
Expand Down

0 comments on commit fb44859

Please sign in to comment.