From 9e204bdfa3c1ebf2e304f93c584174010b487e72 Mon Sep 17 00:00:00 2001 From: "Lumberbot (aka Jack)" <39504233+meeseeksmachine@users.noreply.github.com> Date: Thu, 5 Sep 2024 06:20:04 -0700 Subject: [PATCH] Backport PR #137: improve initial scatter/mouseover performance (#138) Co-authored-by: Kyle Conroy --- CHANGES.rst | 2 ++ lcviz/plugins/coords_info/coords_info.py | 5 +---- lcviz/viewers.py | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4e2f208..2b2ab23 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,8 @@ * bumps lightkurve to 2.5.0 to include upstream bug fixes. [#132] +* Improve scatter viewer and mouseover performance. [#137] + 0.4.2 (07.23.2024) ------------------ diff --git a/lcviz/plugins/coords_info/coords_info.py b/lcviz/plugins/coords_info/coords_info.py index 2f4c570..33f3956 100644 --- a/lcviz/plugins/coords_info/coords_info.py +++ b/lcviz/plugins/coords_info/coords_info.py @@ -89,10 +89,7 @@ def _cursor_fallback(): if self.dataset.selected != 'auto' and self.dataset.selected != lyr.layer.label: continue - # glue-jupyter 1.18 changed from lyr.scatter to lyr.scatter_mark - # TODO: once glue-jupyter is pinned to 1.18 or later, update this to: - # scatter = lyr.scatter_mark - scatter = getattr(lyr, 'scatter_mark', getattr(lyr, 'scatter', None)) + scatter = lyr.scatter_mark lyr_x, lyr_y = scatter.x, scatter.y if not len(lyr_x): continue diff --git a/lcviz/viewers.py b/lcviz/viewers.py index a2e7910..1d0e74d 100644 --- a/lcviz/viewers.py +++ b/lcviz/viewers.py @@ -149,6 +149,7 @@ def _apply_layer_defaults(self, layer_state): if getattr(layer_state.layer, 'meta', {}).get('Plugin', None) == 'Binning': # increased size of binned results, by default layer_state.size = 5 + layer_state.points_mode = 'markers' def set_plot_axes(self): # set which components should be plotted