Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve initial scatter/mouseover performance #137

Merged
merged 7 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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)
------------------
Expand Down
5 changes: 1 addition & 4 deletions lcviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcviz currently requires jdaviz 3.10, which in turn requires glue-jupyter 0.20+ (original comment was a typo glue-jupyter made this change in 0.18, not 1.18, with glue-viz/glue-jupyter#363)

lyr_x, lyr_y = scatter.x, scatter.y
if not len(lyr_x):
continue
Expand Down
1 change: 1 addition & 0 deletions lcviz/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't needed in order to get the improvements from glue-jupyter, but doesn't hurt! If we ever have light curves with enough points where the scatter with markers becomes more expensive than the density plot, we can consider removing this to leave it at the default of 'auto'.


def set_plot_axes(self):
# set which components should be plotted
Expand Down